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.
  1. Initiate an attended transfer call with the third-party recipient.
  2. 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:
  • blind: Blind transfer.
  • attended: Attended transfer.
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 Status Changed event.
  • For blind transfer, enter the call channel ID of the member to be transferred.

    E.g. A and B are in a call, and A is redirected to C via blind transfer. In this case, you should enter the call channel ID of A.

  • For attended transfer, enter the call channel ID of the transferor.

    E.g. A and B are in a call, and B redirects A to C via attended transfer. In this case, you should enter the call channel ID of B.

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:
  • This parameter is REQUIRED when performing blind transfer and initiating an attended transfer call.
  • Make sure the extension has the desired dial permission.
    • If the number is an extension number, and you want the API interface to follow the extension visibility permission set by Client Permission on the PBX, you must enter an extension number that can view the number.
    • If the number is an external number, and the member to be transferred (blind transfer) or the transferor (attended transfer ) has no outbound call permission, you should enter an extension number that has the outbound call permission.
attended_operate No String The operation of attended transfer.
Note: This parameter is required when operate the established attended transfer call.
Valid value:
  • abort: Cancel the call transfer.
  • complete: Confirm the call transfer.
  • threeway: Invite the third-party to join the call.
  • swap: Swap the call between the second-party and the third-party.

    E.g. A and B are in a call, B performs attended transfer to transfer the call to C, A will be held. B can swap the call to talk with A.

Response parameters

Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
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"
}

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"
}