Reputation: 1223
I am using the IVR sample script found here:
https://www.twilio.com/docs/howto/ivrs-call-screening-and-recording
Let's say that someone calls and connects to agent 1, if the agent reject's the call, it then hangs up the person who called (which is pointless). I want to redirect that person if the agent doesn't pick up or the agent rejects the line to a voicemail twimlet (http://twimlets.com/voicemail?Email=my%40email.com&). I know that this should be easy to do but I am having a hard time figuring out where to add the twimlet,<redirect>http://twimlets.com/voicemail?Email=my%40email.com&</redirect>
Upvotes: 0
Views: 297
Reputation: 1308
I think a good place to look for this might be in the OpenVbx project. This is their link http://www.openvbx.org/.
In the source code, I would direct you to have a look at the Dial applet server side implementation. a basic version of steps would be this.
When dialling an agent instead of only dialling one agent, you dial a list, group or department of agents, you can implement your own logic here. I would suggest taking a careful look at how the whisper functionality was written, basically from it you can see that an agent is required to accept the call with interaction by pressing a button, this helps if you agents devices that you are placing calls to, are perhaps mobile devices and go into voicemail. In the end, while you are dialling more than one agent, the first agent to pickup the call is the agent who will be connected to the caller. The rest of the dial attempts will be cancelled for you.
The source code for the project resides here https://github.com/twilio/OpenVBX
while the source code is in PHP, with Twilio it is luckily very easy to see how one would convert this to other languages. You could also simply get the project running and look at the Twiml that is generated when dialling for example and use that as guidance for your own solution.
Upvotes: 2