Place a Twilio call on hold and retrieve it later

只谈情不闲聊 提交于 2019-11-29 21:05:08

问题


I am creating a Twilio application using JavaScript SDK.

I want to implement call hold functionality but I am having trouble implementing it.

What is the process to put a call on hold, when it is initiated by the soft-phone? Also, what is the process when the soft-phone is receiving the call?


回答1:


When the user of the soft phone press Hold you can use the REST API to update that call, sending the call to a queue.

You can do that redirecting the call to a TML file with the <Enqueue> tag.

To retrieve the call to the soft phone you can use the CallSid to update the call and sending it back to the soft phone user.

I already implemented that feature in my app, so let me know if you need some help.




回答2:


Twilio evangelist here.

There are different ways to place a call on "hold". Normally it does not matter whether the call originated from Client or from a PSTN number, the process is generally the same:

  1. Provide Twilio some TwiML that places the call into "hold" then
  2. when you are ready, use that calls CallSid and the REST API to redirect the live call to a new experience.

Now, for placing the call on "hold" there are a couple of options I can suggest:

One is to use the <Play> verb and set the loop attribute to zero, which will tell Twilio to loop over that audio indefinitely. When you are ready to move the call out from "hold", you simply redirect the call.

Another option is to use the <Enqueue> verb and place the call into a call queue. Then when you are ready simply redirect that call back out of the queue to a new experience.

Hope that helps.



来源:https://stackoverflow.com/questions/19345222/place-a-twilio-call-on-hold-and-retrieve-it-later

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!