Twilio Queue Cleanup

会有一股神秘感。 提交于 2019-12-11 10:07:29

问题


I have a scenario where I need to connect an inbound caller with another party, selected dynamically. The logic to select, and connect the 3rd party can take a little time to execute as it involves some additional back-end systems, so I want to <Enqueue /> the original caller while I make the outbound call - this way they get hold music!

When I enqueue the original caller I generate a Guid::NewGuid() for the queue name to ensure they are the only person in it.

All the call flow logic is under control, but I've noticed that I have a lot of queues now that I'll never use again.

Do I need to clean these up as part of my call script? Does Twilio clean them up automatically after some period of inactivity? Is there a cost, or practical limit to the number of queues that I can have at any time?

The doco on the Twilio site is a little thin on this subject - does anyone know? Or have a better mechanism maybe?


回答1:


Twilio evangelist here.

Based on how you describe your app, its sounds like instead of using <Queue>, you could drop the incoming callers into a <Conference>. Using Conference you can still give them wait music while your app goes to connect to the right agent, but since conferences automatically go away once the last caller leaves, there is no need for you to clean them up after.

Also, have you looked at using TaskRouter to help you route those calls to the right agent? Using TaskRouter you can drop the inbound call directly into a TaskQueue while the correct agent is identified based on attributes that you define and becomes available.

Hope that helps.




回答2:


Another Twilio developer evangelist here. :)

In answer to your question, you have nothing to worry about with your Queues. When there are no calls left in a Queue it will get cleaned up on our side, so you have nothing to worry about on your side.

Edit

I was wrong, Queues will not get cleared up automatically. Ideally in this situation where a queue only gets used once for a single user, the queue would then be deleted via the API. However, there are no limits on the number of queues you can have and being unable to delete a queue in a certain situation would not cause problems.



来源:https://stackoverflow.com/questions/35332368/twilio-queue-cleanup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!