...
The call controller tracks the state of the call in progress for a specified period of time after the call is placed and provides this status for quey by applications
Services
...
query by applications.
The security model for these operations is enforced by the sipXrest container. That is, when the operation is invoked from the trusted domain using HTTPS, no pin is required. Otherwise, a pin must be supplied for the operation to succeed.
The service is initiated using HTTPS using HTTPS post and queried using HTTPS get. HTTP is also supported with Digest authentication but it is not the preferred method of service invocation.
Services
The URL prefix for all services is
https://sipxtest.sipxtest.net:6666
The URI is as documented below:
URI | URL Pararameters (Optional) | Methods | Formats |
---|---|---|---|
callcontroller/{callingUser}/{calledUser} | sipMethod=[REFER|INVITE] the default is REFER | POST | Initiates a call from the callingUser to the calledUser |
callcontroller/{callingUser}/{calledUser} | All URL parameters are ignored. Note that you an only get the current call state of you have previously initiated the call from callingUser to calledUser | GET | Get the current call state for any ongoing call between callingUser and calledUser |
...
Examples
There are two ways to Using curl, you would initiate a call , either as calling party as belowfrom callingUser to calledUser from a remote host as follows:
Code Block |
---|
curl -k -X POST -u {calling usercallingUser}:{passwordpin} https://<host>:6666/callcontroller/{calling usercallingUser}/{called usercalledUser}?timeout=<seconds> |
Or as an agent (third party)
Code Block |
---|
curl -k -X POST -u ({agent user name\}:\{agent password\agentPin} https://<host>:6666/callcontroller/<caller><callingUser>/<callee><calleedUser>?agent=<agent<agentName> user name\}\&timeout=<number of seconds> |
...
The following example is to initiate a call between user1 and user2 as user1 who is the calling party.
...
Code Block |
---|
curl -k -X POST -u user3:123 https://sipxtest.sipxtest.net:6666/callcontroller/user1/user2?agent=user3\&timeout=30
|
Return result
On success, HTTP 200 OK returned. no message body.
On Failure, corresponding HTTP status code returned and more plain/text details contained in the message body, for example. "not valid user pin".
Query call setup progress
...
Similar to "place a call", the query can be made either from calling party
Code Block |
---|
curl -k -u \{calling user name\}:\{password\} https://<host>:6666/callcontroller/\{calling user name\}/\{user to be called\}?timeout=<number of seconds>
|
Or as an agent (third party)
Code Block |
---|
curl -k -u (agent user name\}:\{agent password\} https://<host>:6666/callcontroller/<caller>/<callee>?agent=<agent user name\}\&timeout=<number of seconds>
|
...
. The URL is exactly the same as that you would use when placing the call but the method is GET.
Here is an example of how to query call setup progress for call between user1 and user2 as user1.
Code Block |
---|
curl -k -u user1:\{password\}123 https://sipxtest.sipxtest.net:6666/callcontroller/user1/user2 |
...
Code Block |
---|
curl -k -u user3:\{password\}123 -X GET https://sipxtest.sipxtest.net:6666/callcontroller/user1/user2?agent=user3 |
Return result from the query above
The result is XML based as the example below.If the transfer is invoked using REFER, the calling party records the NOTIFY bodies and reports it (uninterpreted) when the user issues an HTTP GET to fetch the call status. This is reported to the caller when a GET is performed as shown below:
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <status-lines xmlns="http://www.sipfoundry.org/sipX/schema/xml/call-status-00-00 "> <status> <timestamp>1259114103662</timestamp> <call-id>7959e447b88502416ee2477f3d36a480@12.23.34.45</call-id> <method>INVITE</method> <status-line>SIP/2.0 100 Trying</status-line> </status> <status> <timestamp>1259114103667</timestamp> <call-id>7959e447b88502416ee2477f3d36a480@12.23.34.45</call-id> <method>INVITE</method> <status-line>SIP/2.0 407 Proxy Authentication Required</status-line> </status> <status> <timestamp>1259114103678</timestamp> <call-id>7959e447b88502416ee2477f3d36a480@12.23.34.45</call-id> <method>INVITE</method> <status-line>SIP/2.0 100 Trying</status-line> </status> <status> <timestamp>1259114103841</timestamp> <call-id>7959e447b88502416ee2477f3d36a480@12.23.34.45</call-id> <method>INVITE</method> <status-line>SIP/2.0 180 Ringing</status-line> </status> </status-lines> |