Alpinestar22
Alpinestar22

Reputation: 543

Twillio Enqueue / Dequeue (or conference) Multiple callers

I am building an "overflow" queue of sorts for a call center. I'll spare you the logical reason and pitfalls of the current call center, but this is the task at hand.

I've taken the following steps:

(1) Create a flow in Twilio studio (to manage some inputs, etc, as well as enqueue the caller) (2) Handle reservations by conferencing with the outbound (cell center) number.

There are two apparent issues:

(1) When a second call goes into the queue, it comes in without a reservation (because my one worker is on the "first" call??) (2) I can essentially continually route folk in the queue to the call center until somebody picks up... however, with Taskrouter, it matches the one worker and the other calls are just stuck in the queue.

Ideally the final functionality would be that anybody in the queue hears the hold music until they are connected to the call center (which has a significant capacity for concurrent calls). I might be overthinking it, but (for example) if 50 calls were in queue, and only one worker - what happens to the 49 calls while the "worker" accepts the reservation? Would I need to create 50 workers? It seems like a bulky workaround, but there has to be a solution by all of you Twilio wiz's out there!

I am handling an assignment callback via Flask app, so that is able to handle the reservation and conference it... however, it can only do this with the first call (and worker) while other calls stack up without a reservation.

Any information is appreciated!

Upvotes: 0

Views: 273

Answers (1)

Alpinestar22
Alpinestar22

Reputation: 543

this was actually fairly easy once I was able to grasp the concept (for anybody that is interested).

For this specific application, task router and the 'conference' instruction (given to the assignment callback) handle connecting the inbound call to the outbound call center - if and only if the call center connects is the conference created. Otherwise, it will find the next available worker (ie call center) and attempt the same process.

Here is a simple conference instruction for your callback URL (in response to a new task):

ret = '{"instruction": "conference", "timeout": "300"}'
resp = Response(response=ret, status = 200, mimetype = 'application/json')

Then, you can either programmatically manage workers, tasks, attributes, etc. The conference instruction handles a lot of the heavy lifting as far as ensuring connections between the inbound and outbound calls, as well as corner cases.

Upvotes: 0

Related Questions