Call command

In this 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. While using an IVR the client can order a call command. For example, you could give your clients a method to give pre-recorded gift calls to their friends or your client could play a

Request parameters

Parameter name Example value Description Mandatory
Dialed 100 Phone number of the callee. yes
ApiExtension 1000 API Extension from where the call will be initiated, it must be a configured API extension. It can be omitted if sent in a response to a call notification. no
CallerId 1000 Phone number of the caller, which will be displayed on the called side. no
CallerDisplayName John Smith Displayed name of the caller, which will be displayed on the called side. no
Url http://yourapp.com/callconnected.php The PBX will send a request to this URL once the call is connected. The PBX awaits a response containing an OZML from the script located at this URL. This URL is not being used during this test. no
ResponseOzML hello When call connected, this OzML script will be executed on the call. no
ErrorUrl http://yourapp.com/error.php This URL will be requested if any errors occur during the call. no
FinishedUrl http://yourapp.com/callfinished.php This URL will be requested when the call is completed successfully. no
RingTime 120 The ring time of the call. If expires, the call will be closed. no
Username admin The username of the account. The username and password parameters are used to authenticate the user. yes
Password abc123 Specifies the password. The username and password parameters are used to authenticate the user. yes

Response parameters

Parameter name Example value Description Mandatory
Code 200 Returns the status code of the response. yes
Message Command successfully executed Returns the description of the response code. yes
NotificationName Callconnected Name of the notification request type. no

OzML example

This OzML script will dial 102, and show the caller ID 3000 to the callee. After the callee picks up the phone, the OzML script on link that you provided in the Url attribute will be executed.

<?xml version="1.0"?>
<Response>
    <Call Url="http://yourdomain.com/ozml_example/call_connected.php" CallerId="3000">102</Call>
</Response>

Example request and response

URL request

http://127.0.0.1:9509/api?command=Call&Dialed=102&ApiExtension=101&Url=http://yourapp.com/callconnected.php&ErrorUrl=http://yourapp.com/error.php&Username=HTTP_User_1&Password=qwe123

Response

<?xml version="1.0"?>
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Code>200</Code>
  <Message>Command successfully executed</Message>
</Response>

More information