Put Caller On Hold And Retrive Back From Hold Using Javascript In Twilio
Solution 1:
In a two party call , as soon as one of the party goes off the call , the call ends. Hence you're experience. If you want both the callers to be on the call and whilst they are on call ,have one go to hold and then bring him back - Use conference. .
The flow should be something like:
- Caller calls a Twilio number
- When call is answered use TwiML to place the caller in conference.
- Initiate a REST API to do a outbound dial to other party
Here is an example of the Twiml that puts the caller into a conference:
<Response><Dial><Conferencebeep="false"waitUrl=""startConferenceOnEnter="true"endConferenceOnExit="true">NoMusicNoBeepRoom
</Conference></Dial></Response>
When you want to put caller on hold, post to /conference
and you can put required participant on hold/unhold using details described here.
$POST /Conference/CFbbe46ff1274e283f7e3ac1df0097ab39/Participants/CA386025c9bf5d6052a1d1ea42b4d16662
-d "Hold=True" \
-d "HoldUrl=https://myapp.com/hold" \
-u 'AC123:{AuthToken}'
Solution 2:
I ask same question to the twilio support center and they give below answer.
It is much easier to use conference..
The following example shows how you can put the first conference participant on hold, and then unhold them once the agent is ready to talk with them: https://www.twilio.com/docs/api/twiml/conference#examples-6
Post a Comment for "Put Caller On Hold And Retrive Back From Hold Using Javascript In Twilio"