Jump to content

Twilio SMS not working after 67.0.2 upgrade


Recommended Posts

Hi all,

Is anyone else having issues with Twilio SMS after upgrading to 67.0.2?

We could all use it fine prior to the upgrade, but now nothing is being sent, and there is nothing hitting the Twilio API.

Is there somewhere I can debug this in logs or something in Vodia?

 

Thanks.

Link to comment
Share on other sites

It appears that Twilio now requires me to have a 'Message Service' in programmable messaging to send.

The Twilio API service now has 'messagingServiceSid' tag that seems to be required (which you get by creating a 'Messaging Service' under programmable messaging - here is the code from Twilio which I have tested and it works:

// Update the path below to your autoload.php, 
// see https://getcomposer.org/doc/01-basic-usage.md 
require_once '/path/to/vendor/autoload.php'; 
 
use Twilio\Rest\Client; 
 
$sid    = "TWILIO ACCOUNT API KEY HERE"; 
$token  = "[AuthToken]"; 
$twilio = new Client($sid, $token); 
 
$message = $twilio->messages 
                  ->create("+PHONE_NUMBER_HERE", // to 
                           array(  
                               "messagingServiceSid" => "MESSAGING_SERVICE_SID_HERE",      
                               "body" => "This is a test" 
                           ) 
                  ); 
 
print($message->sid);

 

What would be AMAZING would be if Vodia was updated to allow a seperate MessagingServiceID per domain!

I have been able to test this using my own PHP code, and it would be a very simple way for Twilio users to be able to separate out their services for reporting.

From what I can see (and I may be wrong):
PBX Settings need: Twilio API Key and Twilio API Secret
Domain Settings need: Twilio Messaging Service ID

When sending the SMS request to Twilio, Vodia pulls the API information from the PBX, and the service id from the domain - in Twilio, all the SMS's sent are seperated into their service IDs, allowing for me to charge for them accordingly.

Link to comment
Share on other sites

This is what we are using for Twilio right now

  Twilio.prototype.send = function(obj) {
    var body = "From=" + encodeURIComponent(obj.from);
    body += "&To=" + encodeURIComponent(obj.to);

    // Do we have an attachment?
    if (obj.url) body += "&MediaUrl=" + encodeURIComponent(obj.url);
    else if (obj.wav) bbody += "&MediaUrl=" + encodeURIComponent(obj.wav);
    else body += "&Body=" + encodeURIComponent(obj.text)
    
    system.http({
      method: 'POST',
      url: this.base + '/Accounts/' + this.username + '/Messages.json',
      header: [
        { name: 'Authorization', value: 'Basic ' + toBase64String(this.username + ':' + this.token), secret: true },
        { name: 'Content-Type', value: 'application/x-www-form-urlencoded' }
      ],
      body: body
    });
  }

The settings are also available on domain level. this.base is 'https://api.twilio.com/2010-04-01' but it can be overwritten if needed.

Link to comment
Share on other sites

  • 1 year later...
On 10/4/2022 at 4:49 AM, jacksonjk said:

I think SMSala is best sms provider as compared to Twillio.

website url: www.smsala.com

You might be able to use SMSALA with the simple GET method already, as well as inbound SMS messages (see https://doc.vodia.com/docs/admin-messages). On their documentation site its not clear if they support MMS as well — if yes it might make sense to add them to the dropdown.

Link to comment
Share on other sites

  • 3 weeks later...

On the back of this is there any way to support Alphanumeric Sender IDs I tried to simply just input my Alphanumerica Sender ID as the ANI thinking that might just do it, but no go. 

Great for 2-FA logins to present "VODIA PBX" etc... 

Change the "From" number or Sender ID for Sending SMS Messages – Twilio Support

SMS seems to be fine in current config even when using 'Message Service' 

Link to comment
Share on other sites

Might just be the form validation that stops you from entering alphanumeric. The Vodia API will take it.

Anyhow that being said, we plan to move on to passkey in 69 instead of 2nd factor. The whole 2nd factor was just a workaround for a flawed system where users have to come up with more-or-less random passwords. 

Link to comment
Share on other sites

On 10/29/2022 at 1:58 AM, Vodia PBX said:

Might just be the form validation that stops you from entering alphanumeric. The Vodia API will take it.

Anyhow that being said, we plan to move on to passkey in 69 instead of 2nd factor. The whole 2nd factor was just a workaround for a flawed system where users have to come up with more-or-less random passwords. 

Looks like the form validation accepts, it seems it was just Twilio that took longer in their backend before my number was truly enabled for Alpha ID.  As I got missed call text messages come through with the name a few hours after posting this. 

Link to comment
Share on other sites

  • 4 months later...

Great to see that SMS is working again.

I have also got Alpha numeric sender id's working too with Twilio which is good.

My problem is that regardless of what I put in the Vodia SMS ANI field, it converts it all to lowercase.  I know that the API for Twilio accepts any case, so is it possible to get this fixed?

 

For example, in the ANI field it shows 'MyComp' but the actual api call is sending it as 'mycomp'.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...