Reputation: 61
I'm familiar with Twilio's enqueue and queue functionality where we put a caller into a queue and when they are the next person in line we connect them to an agent. Pretty straight forward.
I'd like to have an option where the system can call the caller back when they are next in line. So if there are 20 people ahead of them they don't have to sit in queue listening to horrible hold music.
If I put a user in a queue and disconnect them they are removed from the queue. Any suggestions on how to do this?
Upvotes: 1
Views: 186
Reputation: 73027
Twilio developer evangelist here.
The Twilio Queue is for people who remain on the line, so that's not going to work for you in this case.
What you'd want to do is maintain your own queue of callbacks to be made within a database in your application. You can store the time added to the queue with the number to call. Then when you have an available agent, sort the queue by time added, pick the oldest call and generate a call to the agent and then to the waiting user using the REST API.
Does that help at all?
Upvotes: 1