Call

In the Call command an API extension calls a number and once the phone is picked up, a CallConnected request will be sent to the specified URL. In response to this request a set of commands in OzML format can be provided regarding this call (Figure 1). There are OzML examples on the bottom half of the page.

call application xml example
Figure 1 - Call Application XML example

Request parameters

Parameter name Value Description Default value Mandatory
command string value, Call Specifies the type of the HTTP API command. (None) Yes
Dialed int value,
e.g. 1000
The phone number you want to call. (None) Yes
ApiExtension int value,
NULL
e.g. 9994
The phone number of the API extension which makes the call. (None) Yes
CallerId int value
e.g. 3000
The phone number the callee sees as the caller. ApiExtension parameter value No
CallerDisplayName string value,
e.g. John+Smith
The displayed name of the caller. ApiExtension parameter value No
Url string value,
e.g. http%3a%2f%2fxyz.com%2fcall_connected.php
The URL the OzML response is downloaded from. This is where the CallConnected notification is sent to. If it is empty or the URL can't be downloaded then the call will be hung up. (None) Yes
ErrorUrl string value,
e.g. http%3a%2f%2fxyz.com%2ferror_occured.php
This URL is requested if any errors occur during the call. (None) No
These parameters are only required if office user authentication is set in the HTTP API:
Parameter name Value Description
Username string value,
e.g. user1000
This is the username of an Ozeki Phone System office user.
Password string value,
e.g. mypassword12
This is the password belonging to the username.

Response parameters

Parameter name Value Description
Code int value
(200, 300, 301, 302, 303, 401, 402)
Returns the status code of the response. For more infromation go to the status code reference page
Message string value,
e.g. Command successfully executed
Returns the description of the response code. For more infromation go to the status code reference page

OzML examples

Basic speaking OzML:

After the target party picks the phone up it delays for 1 second then says: "Congratulations, this is your first OzML Response command." Then it delays 1 more second and says: "Have a nice day!" Then it plays testsound.wav from the local C drive. Finally the call will be hung up.

<Response>
<Delay>1</Delay>
<Speak>Congratulations, this is your first OzML Response command.</Speak>
<Delay>1</Delay>
<Speak>Have a nice day!</Speak>
<Play>c:\testsound.wav</Play>
</Response>

Blind transfer OzML:

After the target party picks the phone up it delays 1 second then says: "Hello, you will be transferred to another extension. Goodbye!" Then it blind transfers the target party to extension 101. If it can't be blind transfered the next command will execute which says: "Sorry, but blind transfer failed. Please setup extension number 101 in the system." and the call will be hung up.

<Response>
<Delay>1</Delay>
<Speak>Hello, you will be transferred to another extension. Goodbye!</Speak>
<!-- The call will be blind transferred to another extension. To try it please configure
an extension (e. g. SIP extension) in the system, register and set the extension ID
for the command. -->
<BlindTransfer>101</BlindTransfer>
<!-- If blind transfer fails, the following commands will be executed -->
<Speak>Sorry, but blind transfer failed. Please setup extension number 101 in the system.</Speak>
</Response>

SMS sending OzML:

After the target party picks the phone up it delays 1 second then says: "Hello, a test SMS will be sent." Then it tries to send an SMS to recipient 45026467 with this content: "Hello from Ozeki Phone System!" After that it delays 1 more second and the call will be hung up.

<Response>
<Delay>1</Delay>
<Speak>Hello, a test SMS will be sent.</Speak>
<!-- To try out SMS sending, please set an SMS outside line and dialplan rules. -->
<SendSms recipient="45026467">Hello from Ozeki Phone System!</SendSms>
<Delay>1</Delay>
</Response>

Basic IVR OzML:

This speaks the 4 sentences between the <InitialCommands></InitialCommands> nodes repeatedly with a 10 second delay and scans the pressed numbers at the same time.
By pressing 1 an SMS will be sent to 45026467 containing: "Hello from Ozeki Phone System!"
By pressing 2 this sentence will be read by the speak engine: "You pressed button 2. You did nothing."
By pressing 3, you will be blind transferred to number 101. If the transfer was unsuccessfull it says: "Sorry, but blind transfer failed to extension 101."

<Response>
<Delay>1</Delay>
<!-- Defining a simple IVR. Messages will be repeated after 10 seconds. -->
<UserInput timeout="10" repeat="true">
<InitialCommands>
<Speak>Welcome to the Ozeki Phone System IVR.</Speak>
<Speak>To send an SMS, press 1.</Speak>
<Speak>To do nothing, press 2.</Speak>
<Speak>To transfer the call to 101, press 3.</Speak>
</InitialCommands>
<Inputs>
<Input key="1">
<Speak>A test SMS will be sent.</Speak>
<SendSms recipient="45026467">Hello from Ozeki Phone System! </SendSms>
</Input>
<Input key="2">
<Speak>You pressed button 2. You did nothing.</Speak>
</Input>
<Input key="3">
<BlindTransfer>101</BlindTransfer>
<Speak>Sorry, but blind transfer failed to extension 101.</Speak>
</Input>
</Inputs>
</UserInput>
<Speak>Good bye.</Speak>
</Response>

More information