Reputation: 73
I am trying to implement an on-hold functionality in Twilio VOIP. I will first describe the complete scenario:
When a customer calls in, I am calling all available agents, for example:
<Response>
<Dial>
<Client>user_1</Client>
<Client>user_807</Client>
</Dial>
</Response>
Any agent can choose to accept the call. During the call, the agent must be able to put the call on-hold and this is the part where I am stuck and tried a bunch of things. I can put the call on hold by making an UPDATE REST request to the current call and executing:
<Response>
<Enqueue waitUrl="wait-music.xml"></Enqueue>
</Response>
My question is how I can get the call back to the agent.. The agent must be able to retrieve the call back. How can I accomplish this? I can use the <dial>
verb but in my opinion this is strange since I'm already calling with the customer. Should I use <conference>
to accomplish this? In a later stage I also want to be able to cold-transfer calls.
Thanks,
Marcel
Upvotes: 0
Views: 704
Reputation: 837
In a two party call , when you modify a call leg and redirect it to a different TwiML the other leg disconnects. To achieve your requirement <Conference>
is aptly suited . With conference , you can put any leg on and off hold easily.
$POST
/Conference/CFbbe46ff1274e283f7e3ac1df0097ab39/Participants/CA386025c9bf5d6052a1d1ea42b4d16662
-d "Hold=True" \
-d "HoldUrl=https://myapp.com/hold" \
-u 'AC123:{AuthToken}'
For more details see : https://www.twilio.com/blog/2016/06/introducing-conference-hold.html You might find this article on warm and cold transfer useful too : https://twilio.radicalskills.com/library/call-center-transfers.html
Upvotes: 2