New open source SMS Connector module

this module is fantastic! Thank you! I have successfully set it up with Twilio - SMS works but MMS does not… any ideas?

Most likely you have not specified AMPWEBADDRESS as noted in the info box:

This field is used to construct the URL by which the provider (Twilio) will fetch your MMS image.

When you send MMS it is stored as a blob in the database. The media.php script makes it available to your provider. The constructed URL that is passed to your provider for fetching media will look like https://{AMPWEBADDRESS}/smsconn/media.php?...

can you tell me how to setup it up with telnyx ? i am not be able to

do you have a manual to set it up with telnyx how to?

im working on similar solution but to work with direct smpp gateways like kannel, that just needs a simple SQL injection to send sms once the gateway is properly configured.

good job!! @billsimon


@billsimon Great work, this is a turn key solution that opens a world of functionality for the FreePBX community. I do have a few notes id like to add if I may.

I just installed v16.0.8 and noticed that from the SMS connector screen despite adding two separate DIDs, the table in the main screen remains empty. With that being said I am still able to login to UCP as the assigned user and do see both of those numbers available and was able to successfully receive messages. This just leaves me with the inability to edit the DID assignments once they are created.

Secondly, I would love to see some type of notification workflow that could send an email to the assigned users and possibly even include the message.


Thanks; could you put details of the bug on the github issue tracker? And the feature request too. I appreciate the feedback.

1 Like

This is probably the most significant add-on in recent freepbx history!!

I’ve been testing this with Twilio and wanted to know how is everyone allowing incoming message for Twilio through their firewalls? I was wondering if it was possible to open the Twilio webhook through a dedicated port and then allow that port access to the internet? i was unable to find the IP addresses that I should allow for twilio

EDIT - I just realized the solution was really simple - Firewall >> Services >> Web Management (secure) >> ALLOW Internet


1 Like

I’m having a similar issue - outgoing MMS works with Twilio but incoming MMS doesn’t work.

Outgoing + Incoming SMS works
Outgoing MMS works
Incoming MMS doesn’t work.

ampwebaddress and ssl are setup

Any clue what the issue might be?

URL showing up in the twilio console request inspector is correct. HTTP status: 500

Just tested Twilio inbound MMS, worked for me. There is some logging in /var/log/asterisk/freepbx.log; my successful incoming MMS looked like this:

[2023-09-25 17:07:00] [freepbx.INFO]: Webhook (twilio) in: Array (     [ToCountry] => US     [MediaContentType0] => image/jpeg     [ToState] => PA     [SmsMessageSid] => MMd806xyzxyzxyzf664d8184099c82d     [NumMedia] => 1     [ToCity] => MARGARITAVILLE     [FromZip] => 12345     [SmsSid] => MMd806c30xyzxyzxyz4d8184099c82d     [FromState] => PA     [SmsStatus] => received     [FromCity] => MARGARITAVILLE     [Body] =>      [FromCountry] => US     [To] => +1nxxnxxxxxx     [ToZip] => 12345     [NumSegments] => 1     [MessageSid] => MMd806c301xyzxyzxyz64d8184099c82d     [AccountSid] => myaccountsid     [From] => +1nxxnxxxxxx     [MediaUrl0] =>     [ApiVersion] => 2010-04-01 )  [] []

Search your freepbx.log for “Webhook”.

1 Like

So basically this is the error

“failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized

I have added the SID/Auth Token under “Connectivity >> SMS Connector >> Provider Settings” – Do I need to do anything under “Connectivity >> SMS Webhook”?

[2023-09-25 20:03:47] [freepbx.INFO]: Exception Webhook (twilio): file_get_contents( failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized  [] []

Oh, I see. Twilio made a change where now by default you need to authenticate to pull the media files. My account had the legacy default (disabled). You can fix for now by (in Twilio) going to Messaging → Settings → General and set “HTTP Basic Authentication for media access” to Disabled.

In the next release I’ll add auth so you can turn it back on.

1 Like

New error – Unable to store MMS media: Unable to Insert Media into DB

[2023-09-26 18:56:21] [freepbx.INFO]: Exception Webhook (twilio): Unable to store MMS media: Unable to Insert Media into DB [] []

I did reinstall and retest but no luck - was hoping that if there was a DB config or permissions error that might get resolved with the reinstall. I’ve also ran fwconsole chown + fwconsole restart but these both didn’t help either.

I’ll release a new version later in the week that should be a little more robust with Twilio media and also allow you to turn auth back on.


Thank you for your hard work!

Version 16.0.9 has been posted which improves the Twilio provider integration and adds Skyetel.

If you previously installed 16.0.8, the new version will be available in the Module Updates screen or with fwconsole ma upgradeall.


Bill is it possible to get SMS Factory supported?

API Documentation | SMS Factory

A quick glance at that API and I don’t see how it would work. FreePBX SMS is for SMS interactions one number to another. That service looks more like something you would use for broadcast texting. I see a “blast” endpoint but no obvious endpoints for sending text to a single number. Nor any info on inbound.

Version 16.0.10 is posted which adds and has a few other small improvements.

The integration is REST API and allows both SMS and MMS.

Quick start for

  • Enable API access ( and set API secret
    • Enter username and API secret in SMS Connector
  • Edit a DID you want to use for messaging. Under the Short Message Service section, check the “Enable SMS/MMS” and “SMS URL Callback” box.
  • Set the SMS URL Callback to the webhook URL provided by SMS Connector
  • Add the DID in SMS Connector and assign user(s)

Keeps getting better and better.

1 Like