I ran into an issue where I was replying back to an SMS received from Twilio that already had the country code on the front, and the module would then try to add it again, as seen on line 214 of twilio.module:

'To' => '+' . $data['country'] . $data['number'],

Patch attached.

CommentFileSizeAuthor
countrycode_fix.patch900 bytesmjavdev
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mjavdev created an issue. See original summary.

arvinsingla’s picture

Assigned: Unassigned » arvinsingla

Thanks, for the patch. Could you describe the scenario where you were replying? Was the number being passed through based on a rule?

mjavdev’s picture

My scenario may have been a little different than others. I was receiving a HTTP POST from Twilio at a custom route, and then turning around and sending a message back via twilio_send() with the POSTed 'From' field, which already includes the country code.