Transfer a Call
During a call, transfer the call to a third-party.
Supported methods
The API interface can implement the following types of call transfer:
Blind transfer - Transfer a call to a third-party recipient immediately according to the request parameter settings.
Attended transfer - Before a call is transferred, the third-party recipient will be consulted whether to accept the transferred call. You need to call the transfer API twice to achieve attended transfer.
- Initiate an attended transfer call with the third-party recipient.
- Execute the attended transfer operation.
Request URL
POST {base_url}/{api_path}/call/transfer?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | Call transfer type. Valid value:
|
| channel_id | Yes | String | The call channel ID of each member during the call. Note: You can obtain the call channel ID in the (30011) Call State Changed event.
|
| number | No | String | The target number to which the call will be transferred. Note: This parameter is required when performing blind transfer, and initiating an attended transfer call. |
| dial_permission | No | String | Enter the extension number of the transferor. Note:
|
| attended_operate | No | String | The operation of attended transfer. Note: This parameter is required when operate the established attended transfer call. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
| call_id | String | The unique ID of each call. |
Example – Blind Transfer
Extension 2000 and extension 2005 are in a call, and the extension 2000 is redirected to extension 2008 via blind transfer.
Request example
POST /openapi/v1.0/call/transfer?access_token=X5rj5m5f49u3hyf0aJbqirYJPUeZoI0D HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"type": "blind",
"channel_id": "PJSIP/2000-000000ae",
"number": "2008"
}Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"call_id": "1650029138.338"
}Example – Attended Transfer
Extension 2000 and extension 2005 are in a call, and the extension 2005 redirects the call to an external number 5503301 via attended transfer.
Request example
Step 1. Initiate an attended transfer call to external number 5503301.
POST /openapi/v1.0/call/transfer?access_token=X5rj5m5f49u3hyf0aJbqirYJPUeZoI0D HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"type": "attended",
"channel_id": "PJSIP/2005-000000a6",
"number": "5503301",
"dial_permission":"2005"
}Step 2. Confirm the attended transfer.
POST /openapi/v1.0/call/transfer?access_token=LqTflGXS6TTTtMQBfaFQo1GybUv2d9wI HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"type": "attended",
"channel_id": "PJSIP/2005-000000a6",
"attended_operate":"complete"
}Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"call_id": "1650028408.320"
}