How to use Twilio Conversations API together with Taskrouter

326 Views Asked by At

As the title suggests I'm having trouble integrating the Conversations API with Taskrouter capabilities.

The approach I'm using is essentially what is suggested for integrating SMS and Taskrouter here Using SMS and Taskrouter Together

The idea is that when an SMS hits your twilio number you invoke a webhook which will create a conversation and add the inbound number as an MMS participant and then enqueue a task with the conversation SID as an attribute. Then on client side you accept the reservation and join the conversation. Except this doesn't work because the conversation was created on the server-side and so calling getConversationBySid on client side fails to see the conversation.

I'm a bit at a loss here. If I create the task on the server side and then try to create the conversation on the client side and add both participants I lose any messages that they inbound MMS participant sent while the task was waiting in queue.

I'm sure that there's a more elegant design for this but I'm failing to see it. Any advice would be appreciated.

0

There are 0 best solutions below