On 7/25/2012 5:18 PM, Ms. Nancy Wichmann wrote:
I see there are a few modules for SMS messaging in Drupal. Do any of them allow chaining messages to create a dialog? That is, we send one message with choices; they choose one and send that answer to us. Then we can send another message based on the first answer, etc.
 
I've done this with Twilio and some custom code. You will have to keep the state in Drupal somehow (e.g. as comments, nodes, or your own approach). Twilio POSTs to a URL on your server when you receive an SMS, at which point you can create a comment programatically. Then you use the sms api to POST to twilio's api/server and send the reply (which you can also record as a comment). This doesn't take much custom code.

Your difficulty will be in assigning the incoming text to a previous chain, if any. You could do this by requiring a token in the incoming SMS, or by having one chain per user/phone number. If you have a budget, you can get more than one phone number or short code and use those to distinguish different chains the user is participating in, although that seems difficult and/or fragile.

Ted