Call Control APIs
This section describes the Call Control API portion of the PortSIP PBX REST API and provides guidance for developers building 3rd applications. You can use this API to write agent applications that provide a variety of call-related features, from agent state management and call control to supervisor monitoring and call recording.
Authentication
Before calling the REST API to make the call, and control the call, we need to authenticate with the PortSIP PBX to obtain the access_token
. Please refer to the REST API.
Initiate a call directly
GET
/sessions/directly
Use the GET method to initiate a call directly. This API does not require an access_token
. Some hardware is not programmable and only allows pasting the URL to initiate the call. This API is designed for that purpose.
Example
URL Parameters
Response
Initiate a call
POST
/sessions
Use this REST API to initiate a call, the access_token
is required for this API.
Headers
Body
Example of the body
Response
Hang up a call
POST
/sessions/{id}/destroy
Use this API to hang up a call by specifying the session ID. Pass the call session ID to the URL parameter ID.
Example
Headers
Response
Hold a call
POST
/sessions/{id}/hold
Use this API to hold a call by specifying the session ID. Pass the call session ID to the URL parameter ID.
Example
Headers
Body
Response
Unhold a call
POST
/sessions/{id}/unhold
Use this API to unhold a call by specifying the session ID. Pass the call session ID to the URL parameter ID.
Example
Headers
Body
Response
Blind transfer a call
POST
/sessions/{id}/refer
Use this API to blind transfer a call by specifying the session ID. Pass the call session ID to the URL parameter ID.
Headers
Body
Example
1001 has established a call. Use the following body payload to blind transfer extension 1001 to the number 0033187691:
Response
Attended transfer a call
POST
/sessions/{id}/attended_refer
Use this API to attended transfer a call by specifying the session ID. Pass the current call session ID to the URL parameter ID.
Consider this scenario: Extension 1001 establishes calls with both 1002 and 1003. Now, use this API to perform an attended transfer, which will connect the call between 1002 and 1003, and extension 1001 will be disconnected from the calls.
Headers
Body
Example
Extension 1001 establishes calls with both 1002 and 1003. Now, use this API to perform an attended transfer, which will connect the call between 1002 and 1003, and extension 1001 will be disconnected from the calls.
Response
Last updated