Try put on hold a call and then retrieve that

天大地大妈咪最大 提交于 2019-12-25 10:01:18

问题


How can put on hold a live call?

And respect that,

I'm using Javascript SDK.

How can put on hold a live call with Twilio.Device or Twilio.Comunication?

For example:

  • Customer phones to Company.

  • Agent of Company response the call

  • Agent and Customer are Speaking

  • Agent puts on hold a call

  • Customer listen a sound

  • Agent is joins again on the call to continue speaking

  • The call ending

I hope I've explained myself well

Sorry for my english!

Thanks


回答1:


Twilio evangelist here.

There is no way to put a call "on hold" directly from the Javascript SDK. What you could do is redirect the ongoing call to a new set of TwiML which provides an "on hold" experience like playing an audio file, or putting the call into a Queue.

We have a Twimlet that provides the ability to loop over an audio file as a "hold" experience here:

https://www.twilio.com/labs/twimlets/holdmusic

As an example doing this, you would use some TwiML that looks something like this:

<Response>
    <Say> Thank you for calling, a representative will be with you shortly</Say>
   <Play loop="100">http://www.mydomain.foo/hold-music.mp3</Play>
</Response>

This would loop indefinitely. To move the caller back out of hold, you use the REST API to redirect the call:

POST https://api.twilio.com/2010-04-01/Account/{YourAccountSid}/Calls/{WaitingCallersCallSid}
CurrentUrl=http://www.example.com/dial-representitive

Those samples contain code from a blog post that walks you through this scenario:

https://www.twilio.com/blog/2009/09/call-queueing-putting-callers-on-hold-calll-redirect-new-url-new-feature.html

Hope that helps.



来源:https://stackoverflow.com/questions/34677501/try-put-on-hold-a-call-and-then-retrieve-that

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