API - Call Control Actions

This is the developer reference document for the call control action API endpoints. The call control actions allow for a call to be created, transferred, parked, and unparked. 

Base URL

https://api.cytracom.net/v1.0/action

API Endpoints for Call Control Actions

VERB URL PATH ABOUT
 POST  /chan/originate  Originate a Call
 POST  /chan/blind-transfer  Transfer a Call
 POST  /chan/park  Park a Call
 POST  /chan/unpark  Unpark a Call

Originate a Call:

/chan/originate

Originating a phone call can be accomplished via this call control action. Both the caller and callee are defined in order to setup the call. The caller's phone will ring as though the callee is initiating the call. The caller picks up and the callee's phone will then ring. The following data is used for this request:

Field Description Mandatory
number Phone number to be dialed (callee). Yes
extension_number Extension number that is originating the call (caller). Yes
sync Indicator for synchronous (true) or asynchronous (false) with asynchronous as the default if not specified. The synchronous method will respond with the  No


Example cURL Request:

curl --request POST \
  --url https://api.cytracom.net/v1.0/action/chan/originate \
  --user token:<<YOUR-TOKEN>> \
  --header 'content-type: application/json' \
  --data '{"number": "8003569377", "extension_number": "226", "sync": "false"}'

Example JSON Response for Asynchronous (sync=false):

{"msg": "Command Sent Successfully", "code": 200}

Example JSON Response for Synchronous (sync=true):

{
"msg": "Command Sent Successfully",
"data": {
"linked_id": "1516918305610.758098"
"channel_id": "7b425045-8977-4529-8bf5-ebcbbdf41db0"
},
"code": 200
}

Transfer a Call:

 /chan/blind-transfer

Transferring a phone call can be accomplished via this call control action. The identifier of the call is needed and the destination number. The following data is used for this request:

Field Description Mandatory
channel_id Identifier of the call that can be transferred. The call events must be monitored to capture this identifier. This is the channel id which you get from either dial.begin or dial.end event. Use channel_id of the "caller" to transfer the call and use the channel_id of the "called" to transfer that call. Use direction of the call to determine "caller" and "called" parties. Yes
to_number Extension or phone number to receive the call. Yes


Example cURL Request:

curl --request POST \
  --url https://api.cytracom.net/v1.0/action/chan/blind-transfer \
  --user token:<<YOUR-TOKEN>> \
  --header 'content-type: application/json' \
  --data '{"channel_id": "7b425045-8977-4529-8bf5-ebcbbdf41db0", "to_number": "200"}'

Example JSON Response:

{"msg": "Command Sent Successfully", "code": 200} 

Park a Call:

 /chan/park

Parking a phone call can be accomplished via this call control action. The identifier of the call is needed and the destination parking spot number. The following data is used for this request:

Field Description Mandatory
channel_id Identifier of the call leg to be transferred. The call events must be monitored to capture this identifier. Yes
parking_spot Extension Number of the desired parking spot to be transferred to (Max of 10 slots: 701, 702, 703, ... 710). Yes


Example cURL Request:

curl --request POST \
  --url https://api.cytracom.net/v1.0/action/chan/park \
  --user token:<<YOUR-TOKEN>> \
  --header 'content-type: application/json' \
  --data '{"channel_id": "7b425045-8977-4529-8bf5-ebcbbdf41db0", "parking_spot": "701"}'

Example JSON Response:

{"msg": "Command Sent Successfully", "code": 200}

 


Unpark a Call:

 /chan/unpark

Unparking a phone call can be accomplished via this call control action. The extension of the receiving parked call is needed and the parking spot number. The following data is used for this request:

Field Description Mandatory
parking_spot The of the desired parking spot to be connected to the extension (Typically: 701, 702, 703, ... 710). Yes
extension_number Extension number that is to be connected. Yes


Example cURL Request:

curl --request POST \
  --url https://api.cytracom.net/v1.0/action/chan/unpark \
  --user token:<<YOUR-TOKEN>> \
  --header 'content-type: application/json' \
  --data '{"parking_spot": "701", "extension_number": "226"}'

Example JSON Response:

{"msg": "Command Sent Successfully", "code": 200}

 

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request