メニュー

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Call Transfer via SIP REFER

Call transfer enables you to move an active call from one endpoint to another. Twilio's Elastic SIP Trunking product supports "blind" call transfers. This means you're now able to request a call be transferred by sending Twilio a SIP REFER message from your SIP communications infrastructure. Twilio will serve as the pivot-point and handle the call redirect thereby allowing you to free up resources in your IP communications infrastrcuture that are no longer needed.

Call transfers are enabled on a per-Trunk basis, this enables transfers to any SIP destination. Optionally, you may also enable call Transfers to the PSTN.

To start transferring calls, log into the Twilio Console, andnavigate to an existing Elastic SIP Trunk (or create a new Elastic SIP Trunk):

  1. Enable Call Transfers on that Trunk under General Settings
  2. Optionally enable call transfers to the PSTN via your Trunk. This is optional as you may not want to allow calls to be transferred to the PSTN given the associated billing implications of such a transfer.

Place a call via your Elastic SIP Trunk; once established, initiate a call transfer from your phone. Twilio will receive that request & transfer your call. Check your Twilio Call Log in the Console to confirm the transfer worked as requested and to see all relevant call details.

Call Transfer call flow

Call Transfer to another SIP endpoint

Let's start with an active Elastic SIP Trunking Call established from your PBX/SBC via Twilio to the PSTN.

Elastic SIP Trunking call

The players are:

  • Transferor (your PBX/SBC) - The party initiating the transfer of the Transferee to the Transfer-target.
  • Transferee (Twilio/PSTN) - The party being transferred to the Transfer-target.
  • Transfer-target (your PBX/SBC) - The new party being introduced to the Transferee.

SIP REFER to SIP endpoint

Everything kicks off with the SIP REFER message from your PBX/SBC towards Twilio. Within the SIP REFER is a Refer-to header (designating a new SIP endpoint as the Transfer-target). Upon receiving the SIP REFER, Twilio returns a 202 Accepted response to your PBX/SBC. This informs you that Twilio is willing to carry out the transfer.

The original call is placed on hold (not shown in the call flow).

The SIP REFER creates a quasi-subscription between the Transferor (your PBX/SBC) and Twilio. Even though there wasn't a SIP SUBSCRIBE message sent, for the duration of the transfer, Twilio will act as if such a subscription exists.

Twilio sends a SIP INVITE to the new SIP endpoint which processes the SIP INVITE as a normal, incoming call. At this time, Twilio will send SIP NOTIFY messages to inform the Transferor of the status (100 Trying, 200 OK) of the new call from Twilio to the new SIP endpoint.

Once the new call is answered, the Transferor will terminate the existing, held call to the original SIP endpoint.

Please note that early media with Call Transfers is not supported.

Call Transfer to the PSTN

In order to transfer a call to the PSTN you must include your Trunking Termination Domain for example sip:+14152908007@{my-trunk}.pstn.twilio.com or alternatively use a Tel-URI for example tel:+14152909007 in the Refer-To header.

Call Transfers to Emergency Services (911/933) are not supported.

コールログ

If you look at your Elastic SIP Trunking call logs, you'll notice that the Original Call has a "Child Call" representing the new call established as a result of the requested Call Transfer.

料金設定

Initiating a Call Transfer via your Elastic SIP Trunk is free, however you'll continue to be responsible for the per-minute Trunking charges to the referred-to destination on your account.

Please refer to the following tables to understand the details around Billing and Call Logs:

Trunking Termination Billing/Logs with Call Transfers

Transfer Scenario

Parent Call Billing

Parent Call Log

Child Call Billing

Child Call Log

Trunking Termination (from:A to:B)

Transfer to SIP (to:C)

Trunking Termination (from:A to:B) x Parent call duration

from:A to:B

Trunking Termination (from:C to:B) x Child call duration

from:B to:C

Trunking Termination (from:A to:B) Transfer to PSTN (to:C)

Trunking Termination (from:A to:B) x Parent call duration

from:A to:B

Trunking Termination (from:A to:B) x Child call duration +

Trunking Termination (from:A to:C) x Child call duration

from:B to:C

Trunking Origination Billing/Logs with Call Transfers

Transfer Scenario

Parent Call Billing

Parent Call Log

Child Call Billing

Child Call Log

Trunking Origination (from:A to B)

Transfer to Public SIP (to:C)

Trunking Origination (from:A to:B) x Parent call duration

from:A to:B

Trunking Origination (from:A to:C) x Child call duration

from: A to:C

Trunking Origination (from:A to B)

Transfer to PSTN (to:C)

Trunking Origination (from:A to:B) x Parent call duration

from:A to:B

Trunking Origination (from:A to:B) x Child call duration +

Trunking Termination (from:B to:C) x Child call duration

from:A to C



Rate this page:

ヘルプが必要ですか?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.