Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
countrycode_fix.patch | 900 bytes | mjavdev |
Comments
Comment #2
arvinsingla CreditAttribution: arvinsingla commentedThanks, for the patch. Could you describe the scenario where you were replying? Was the number being passed through based on a rule?
Comment #3
mjavdev CreditAttribution: mjavdev commentedMy 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.