Twilio,如何将正在进行的呼叫转移到另一个号码 [英] Twilio, How to transfer a in-progress call to another number

查看:85
本文介绍了Twilio,如何将正在进行的呼叫转移到另一个号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将正在进行的呼叫转移到另一个号码.我正在使用的概念是在正在进行呼叫时使用update方法并拨打我要连接的号码,并且该号码正在工作,但是与第一个呼叫者的连接断开/

How to transfer a in-progress call to another number.The concept that I m using is to use the update method when the call is in in-progress and dial the number that I wanted To connect and It is working but the connection with the first caller is breaking/

转移呼叫过程的代码-

1 .拨打电话的过程-

 <Response>
  <Dial callerId="callerid">
    <Number statusCallbackEvent="initiated ringing answered completed" statusCallback="urltohadlestatus">user_number</Number>
  </Dial> 
</Response>

2 .转移呼叫的过程 我已经使用了update方法来转移呼叫.

2. process to process to transfer the call- I have used the update method to transfer the call.

  function update_call1($CallSid, $admin_no) {
    $rr = array(
        "url" => "trurl?admin_no=".$admin_no,
        "method" => "POST"
    );
    $call = $this->client->calls($CallSid)->update($rr);
    return $call->to;
}

并使用了该TwiML

and used this TwiML

<Response>
        <Dial>admin_number_call_to_be_transfered</Dial>
</Response> 

这是转移呼叫,但是当管理员收到呼叫时,它将断开呼叫. 我需要的是当杰克打电话给詹妮,现在杰克想将呼叫转移到jhonny,而当呼叫转移到jhonny时,杰克猎犬将与呼叫断开连接.

what this does is transfer the call but when admin receives it,It disconnects the call. And what I need like when jack make call to jenny and now jack want to transfer the call to jhonny and when call is transferred to jhonny, jack shound be disconnected from the call.

推荐答案

此处是Twilio开发人员的福音.

Twilio developer evangelist here.

您在这里有两个选择.呼叫转移后,如果没有其他事情,另一个呼叫者将掉线.有两种方法可以实现此目的.

You have two options here. Once the call is transferred away, the other caller will drop if it has nothing else to do. There are two ways you can achieve this.

您可以将呼叫者放在 <Conference> 中.然后,在转接呼叫者时,另一个呼叫保留在会议室中.有一个很好的关于热转移的指南使用技术,这可能会有所帮助.

You can either put the callers in a <Conference>. Then when the caller is transferred the other call remains in the conference room. There is a good tutorial on warm transfers using this technique, which might help.

或者,如果现在掉线的呼叫方是

Alternatively, if the side of the call that is dropping out right now is the one that generated the call from the Twilio REST API you can add more TwiML below the <Dial> verb to have the call continue. For example:

<Response>
  <Dial>OTHER_NUMBER</Dial>
  <Say loop="0">You are still on the call.</Say>
</Response>

一旦另一端转移了,只会继续说您仍在通话中".

Will just keep saying "You are still on the call" once the other end is transferred away.

您还可以使用 action属性来实现此目标, c1> .使用action属性意味着Twilio将对您指定的URL发出Webhook请求,并使用该响应中的TwiML进行呼叫.

You can also achieve this with the action attribute for <Dial>. Using the action attribute means that Twilio will make a webhook request to the URL you specify and use the TwiML from that response to carry on the call.

这篇关于Twilio,如何将正在进行的呼叫转移到另一个号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆