Via callcontroller RESTFul URL, third party call control and call status query can be made to sipXecs.
Place a call
Syntax & Examples
There are two ways to initiate a call, either as calling party as below
Code Block |
---|
Wiki Markup |
The _SipXcallController_ is a restful service for third party call control. It is bundled as a jar file and is loaded by the _sipXrest_ container on initialization. h1. h2. Services || URI \\ || URL Pararameters (Optional)\\ || Methods \\ || Formats\\ || | callcontroller/{callingUser}/{calledUser}\\ | sipMethod=\[REFER\|INVITE\] the defualt is INVITE\\ timeout=<seconds> - the time for which the calling party is alerted before pickup. If the callng party does not pickup in that time period, the call is aborted.\\ agent=<agentUser> the user name of the agent that is placing the third party call. This defaults to the callingUser\\ subject=<subject> Subject of the call. Determines what goes into the SIP subject header of the initial call setup INVITE.\\ isForwardingAllowed=\[true\|false\] default is false whether or not forwarding is allowed for the initial INVITE\\ resultCacheTime=<seconds> The amount of time for which to keep the call progress cache record in memory.\\ | POST\\ | Initiates a call from the callingUser to the calledUser\\ | | | | | | h2. Syntax & Examples There are two ways to initiate a call, either as calling party as below {code} curl -k -X POST -u \{calling user name\}:\{password\} https://<host>:6666/callcontroller/\{calling user name\}/\{user to be called\called user}?timeout=<number<seconds> of{code} seconds> Or as an agent (third party) |
...
{code |
} curl -k -X POST -u (agent user name\}:\{agent password\} https://<host>:6666/callcontroller/<caller>/<callee>?agent=<agent user name\}\&timeout=<number of seconds> |
- Note that timeout is optional*
The following example is to initiate a call between user1 and user2 as user1 who is the calling party.
Code Block |
---|
{code} * The following example is to initiate a call between user1 and user2 as user1 who is the calling party. {code} curl -k -X POST -u user1:123 https://sipxtest.sipxtest.net:6666/callcontroller/user1/user2 {code} An example to initiate a call between user1 and user2 as user3 who is a third party agent. |
...
{code |
} 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
Syntax & Examples
Similar to "place a call", the query can be made either from calling party
Code Block |
---|
{code} h2. 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". h1. Query call setup progress h2. Syntax & Examples Similar to "place a call", the query can be made either from calling party {code} curl -k -u \{calling user name\}:\{password\} https://<host>:6666/callcontroller/\{calling user name\}/\{user to be called\}?timeout=<number of seconds> {code} Or as an agent (third party) |
...
{code |
}
curl -k -u (agent user name\}:\{agent password\} https://<host>:6666/callcontroller/<caller>/<callee>?agent=<agent user name\}\&timeout=<number of seconds>
|
...
{code} * *- timeout is optional, by default is 30 seconds.\* |
...
Here is an example of how to query call setup progress for call between user1 and user2 as user1. |
...
Code Block |
---|
{code} curl -k -u user1:\{password\} https://sipxtest.sipxtest.net:6666/callcontroller/user1/user2 |
Here is an example of how to query call setup progress for call between user1 and user2 via agent user3 from sipX trusted domain, no password required.
Code Block |
---|
{code} Here is an example of how to query call setup progress for call between user1 and user2 via agent user3 from sipX trusted domain, no password required. {code} curl -k https://sipxtest.sipxtest.net:6666/callcontroller/user1/user2?agent=user3 |
Here is an example of how to query call setup progress for call between user1 and user2 via agent user3 from sipX's non-trusted domain.
Code Block |
---|
{code} Here is an example of how to query call setup progress for call between user1 and user2 via agent user3 from sipX's non-trusted domain. {code} curl -k -u user3:\{password\} -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.
Code Block | ||
---|---|---|
xml | xml | {code} h2. Return result from the query above The result is XML based as the example below. {code:xml} <?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> {code} |