0
votes

So here's the use case: we want to bridge chats from our mobile application to sms, so that they don't have to use a custom messenger app. Server-side, using a service like Twilio, would you have to provision separate phone numbers for every session/conversation? If so, that would be prohibitively expensive.

In a simple use case, one server phone number can handle all the incoming sms messages from multiple clients and conversations. It can, based on the client sender's phone number, discriminate what conversation the sms belongs to and send appropriate replies back filtered to the phone numbers of the participants in each conversation. This would allow multiple conversations to be managed by a single server phone number.

However, in an enhanced use case, if the client is in more than one conversation at the same time, there is no easy way to determine which conversation the client's reply was for from the server unless we can somehow embed info in the reply text itself.

Is that just a limitation or is there a way to allow for this enhanced use case?

Is there something in Twilio or in SMS technology, or in the way that I'm thinking about this that would allow that conversation info to be sent back in a fool-proof way (not making the user manually type the conversation id for instance) to allow multiplexing multiple concurrent sms conversations from the same client user?

1
"unless we can somehow embed info in the reply text itself." - Yes, if the client has multiple conversations, he could use sending a key to determine to whom the sms is adressed. E.g. Hello! -> #JDoe Hello! I saw this in banking. - John_West
if the user has to type in the "key" themselves, I think it would be unreliable unfortunately - MonkeyBonkey
There's another way if there is some date-time info embedded in common sms. Parallel to sending sms to server, app sends an internet request to server to notify about sended sms (date-time) and to whom it has been sent (target user unique login/id, e.g). Server looks for this sms in the queue of sms's recieved from this user. If date-time agree, (or some other info, need some knolewdge about sms headers) server re-send the sms to the target user. - John_West
the target user info is hard to embed I would imagine since it's just going to a server phone number, the Twilio answer below seems it would work - using a small pool of phone numbers and discriminating based on source number twilio.com/help/faq/sms/… - MonkeyBonkey

1 Answers

2
votes

Twilio developer evangelist here.

I'm afraid the ability to have multiple conversations between the same two parties in SMS is not possible due to the limitations of SMS itself.

The way to deal with this multiplexing is to use different numbers for different conversations. You would use a pool of numbers, as large as the maximum number of concurrent conversations one user is having with your service, to serve each conversation.

The way you would do this is best described in this Twilio article on sending SMS messages between users.

Let me know if this helps at all.