メニュー

Expand
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?

REFER to Twilio (Beta)

Call transfer enables you to move an active call from one endpoint to another. Twilio's programmable SIP call 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 infrastructure that are no longer needed.

The call transfers can be invoked on both inbound and outbound SIP calls. For example, on an inbound SIP call to a Twilio SIP Domain, you may want to transfer the caller to back to a different agent by pressing the "Transfer" button from your SIP phone. Your SIP phone will provide the contact information of the new agent and instruct Twilio to initiate a transfer. Twilio will initiate the transfer and bridge the initial caller with new agent. Similarly, you can initate a transfer towards Twilio on an outbound SIP call.

Refer from your SIP device will be sent as a webhook to your application including Refer-to-Target. Twilio referUrl is an attribute in Dial verb which receives the webhook requests. As long as one part of the call leg is SIP then Twilio will honor the Refer method that your SIP device is sending. You could also send contextual information of the caller as a UUI header or Custom header along with "Refer-to-Target"

Twilio will ONLY honor REFER if the established SIP call is in a Dial verb with one of the following nouns...

  • SIP
  • 番号
  • Client

For example Conference, Sim and Queue nouns are NOT suppported!

How to send Refer to Twilio

Ensure that referUrl is present in Dial Verb attribute

属性 許容値 Default Values
referUrl Any Url なし
referMethod GET, POST POST

The Refer method details along with "ReferTransferTarget" contact information is passed on to the Webhook. Your Application can is allowed to all the programmable voice features like Dial, Say, Play, Gather, Enqueue, Sim.

Here is an example call flow. This shows that UserA called a bank and connected with Bank AgentA. They finished their initial conversation and now the UserA would want to connect to another department AgentB. AgentA sends the Refer to Twilio and Twilio bridges the call between UserA and AgentB.

Screen Shot 2020-07-08 at 7.00.44 PM.png

        
        
        
        

        The above example shows there is no "answerOnBridge" attribute in Dial verb. Therefore, right after the webhook is fetched Twilio will immediately sends the Notify and disconnect the "Transferor" call leg (AgentA in the above call flow). If the Tranfer-Target (AgentB in the above call flow) did not answer the call or if the call fails or the App fetch fails UserA call will get disconnected.

              
              
              
              

              The answerOnBridge behavior described below is not yet supported

              The above example shows there is "answerOnBridge" attribute in Dial verb. Therefore, Twilio will disconnect the "Transferor" call leg (AgentA in the above call flow) after the Tranfer-Target (AgentB in the above call flow) answers the call. If for some reason the Transfer-Target (AgentB in the above call flow) did not pick the call or if the call failed in the middle or the App fetch fails UserA call will get automatically connected with AgentA again.

              ユースケース

              In this example, we will follow the call flow explained above.

              • Initial call - UserA calls AgentA in a bank. They are connected and happily resolving the issues UserA had.
              • Refer - UserA wants to connect to another department in the bank. AgentA presses transfer button and pass on the contact information.
              • Final call - UserA is now connected to AgentB. The initial call is teared down
              Scenarios

              Initial call is connected or disconnected

              answerOnBridge is there

              Initial call is connected or disconnected

              answerOnBridge is not there

              referUrl is executed

              Initial call is still connected

              Initial call is disconnected
              AgentB answered the call

              Initial call will now get disconnected

              Initial call got disconnected right after the referUrl is excuted, see above
              AgentB did not answer the call

              Initial call can be re-established. So UserA will be connected to AgentA again

              Initial call got disconnected right after the referUrl is excuted. Re-establishing the initial call will not be possible
              referUrl is not reachable

              Initial call can be re-established. So UserA will be connected to AgentA again

              Initial call got disconnected right after the referUrl is excuted. Re-establishing the initial call will not be possible
              referUrl attribute itself is not present in the Dial Verb

              Twilio will generate an alert and initial call wil be re-established. So UserA will be connected to AgentA again

              Twilio will generate an alert and initial call will be re-established. So UserA will be connected to AgentA again

              Join REFER to Twilio Beta

              If you want to be part ofthe SIP REFER to Twilio beta, please fill out our Request Form with your information, and you will be contacted with more details.

              NOTE: As this is a beta feature, we do NOT recommend this feature to be running in production environments!!

              Rate this page:

              ヘルプが必要ですか?

              誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。