New open source SMS Connector module

It’s strange you are getting {MEDIA} in your inbound webhook. That variable at voip.ms should be replaced with a URL that the connector will grab to get a MMS photo if exists, or should be empty. You might try removing the ;media={MEDIA} part from your webhook and see whether that changes the behavior.

edit:

I tested this some more on my voip.ms configuration and the log for a normal inbound SMS has media with an empty value, and then returns a 202 to voip.ms. In your case it’s not returning 202 so voip.ms keeps trying to send you the same messages over and over.

[2024-02-04 20:37:54] [freepbx.INFO]: Webhook (voipms) in: Array (     [provider] => voipms     [to] => NXXNXXXXXX     [from] => NXXNXXXXXX     [message] => trying again     [id] => 74224707     [date] => 2024-02-04 20:37:53     [media] =>  )  [] []
[2024-02-04 20:37:54] [freepbx.INFO]: Webhook (voipms): Return Code 202 [] []

That seems to have worked:
https://pbx.xxxxx.xom/smsconn/provider.php?provider=voipms;to={TO};from={FROM};message={MESSAGE};id={ID};date={TIMESTAMP};

Thanks. We continue to test. It looks like when we re-provision we get all the old crap but that is likely some admin task we can do to clear.

Please send you “donate” or bill link :slight_smile:

If you want to clear all messages out:

fwconsole m

delete from sms_messages;

delete from sms_media;

1 Like

Hi Bill,

I guess I should have been clearer on who wanted it…sorry for the confusion. We have a bunch of interest from my users and customers in using your module who happen to use Siptrunk.com for thier trunking. I was able to get them to give us a test account that is SMS enabled that we can give you as a playground. I cant contribute code myself but I can get some direct support from one of thier engineers or potentially code because we have a bunch of users on thier stuff. (they also own flowroute and nexvortex) so we have users that use them too for rural users who have limited porting options but I can contribute some beer money for the cause :wink:

Playing around with SIP messaging now.

I plan to start a wiki page on the Github repo to track SIP clients and phones that work with this. If you test out the new features, let me know your results. The main thing missing with SIP messaging to the clients is queuing of messages if client is offline. I added email notification for that case. You can go back and review a message thread in UCP when the SIP client’s message history is incomplete.

3 Likes

Awesome, thank you for your contributions @billsimon!

Is anyone using the module with ClearlyAnywhere / Acrobits on their mobile device alongside Flowroute as their trunk provider

I have set everything up and can send and receive SMS and MMS messages – but when i send a message i get an error (initially) but then the messages do get sent out

Spoke with Clearly support about the issue and was told:

Looks like the Module used by your trunk is sending a message regarding an Index that is not recognized by the app.

You may reach out to them to have their module not send that message.

What is the error you are getting?

i think this is the error:

~> 2024-02-19T17:54:31.630Z (1708365271630205)
WebServiceAgent[1205B6AE0]: Request response body: <html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'><title>Slim Application Error</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>Slim Application Error</h1><p>The application could not run because of the following error:</p><h2>Details</h2><div><strong>Type:</strong> Whoops\Exception\ErrorException</div><div><strong>Code:</strong> 8</div><div><strong>Message:</strong> Undefined index: emid</div><div><strong>File:</strong> /var/www/html/admin/modules/clearlysp/CIP/Controllers/v1/Sms.php</div><div><strong>Line:</strong> 7</div><h2>Trace</h2><pre>#0 /var/www/html/admin/modules/clearlysp/CIP/Controllers/v1/Sms.php(7): Whoops\Run-&gt;handleError()
#1 [internal function]: FreePBX\modules\Clearlysp\CIP\Controllers\v1\Sms-&gt;sendMessage()
#2 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func()
#3 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse-&gt;__invoke()
#4 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route-&gt;__invoke()
#5 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/Route.php(268): Slim\Route-&gt;callMiddlewareStack()
#6 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/App.php(503): Slim\Route-&gt;run()
#7 /var/www/html/admin/modules/clearlysp/CIP/ClearlyMiddleware.php(7): Slim\App-&gt;__invoke()
#8 [internal function]: FreePBX\modules\Clearlysp\CIP\ClearlyMiddleware-&gt;__invoke()
#9 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
#10 [internal function]: Slim\DeferredCallable-&gt;__invoke()
#11 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
#12 /var/www/html/admin/modules/clearlysp/CIP/ClearlyAuthMiddleware.php(7): Slim\App-&gt;Slim\{closure}()
#13 [internal function]: FreePBX\modules\Clearlysp\CIP\ClearlyAuthMiddleware-&gt;__invoke()
#14 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
#15 [internal function]: Slim\DeferredCallable-&gt;__invoke()
#16 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
#17 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App-&gt;Slim\{closure}()
#18 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/App.php(392): Slim\App-&gt;callMiddlewareStack()
#19 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/App.php(297): Slim\App-&gt;process()
#20 /var/www/html/admin/modules/clearlysp/CIP/ClearlyAPI.php(7): Slim\App-&gt;run()
#21 /var/www/html/admin/modules/clearlysp/Clearlysp.class.php(7): FreePBX\modules\Clearlysp\CIP\ClearlyAPI-&gt;handleRest()
#22 /var/www/html/admin/libraries/BMO/Ajax.class.php(127): FreePBX\modules\Clearlysp-&gt;ajaxCustomHandler()
#23 /var/www/html/admin/ajax.php(63): FreePBX\Ajax-&gt;doRequest()
#24 /var/www/html/admin/api/api.php(3): include('/var/www/html/a...')
#25 {main}</pre><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v84a3a4012de94ce1a686ba8c167c359c1696973893317" integrity="sha512-euoFGowhlaLqXsPWQ48qSkBSCFs3DPRyiwVu3FjR96cMPx+Fr+gpWRhIafcHwqwCqWS42RZhIudOvEI+Ckf6MA==" data-cf-beacon='{"rayId":"85806017cb5f236b","version":"2024.2.0","token":"a306721cac6c4423a2400363189596d6"}' crossorigin="anonymous"></script>
</body></html>

~> 2024-02-19T17:54:31.630Z (1708365271630370)
WebService::Response
Couldn't parse server response : <html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'><title>Slim Application Error</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>Slim Application Error</h1><p>The application could not run because of the following error:</p><h2>Details</h2><div><strong>Type:</strong> Whoops\Exception\ErrorException</div><div><strong>Code:</strong> 8</div><div><strong>Message:</strong> Undefined index: emid</div><div><strong>File:</strong> /var/www/html/admin/modules/clearlysp/CIP/Controllers/v1/Sms.php</div><div><strong>Line:</strong> 7</div><h2>Trace</h2><pre>#0 /var/www/html/admin/modules/clearlysp/CIP/Controllers/v1/Sms.php(7): Whoops\Run-&gt;handleError()
                                 #1 [internal function]: FreePBX\modules\Clearlysp\CIP\Controllers\v1\Sms-&gt;sendMessage()
                                 #2 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func()
                                 #3 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse-&gt;__invoke()
                                 #4 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route-&gt;__invoke()
                                 #5 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/Route.php(268): Slim\Route-&gt;callMiddlewareStack()
                                 #6 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/App.php(503): Slim\Route-&gt;run()
                                 #7 /var/www/html/admin/modules/clearlysp/CIP/ClearlyMiddleware.php(7): Slim\App-&gt;__invoke()
                                 #8 [internal function]: FreePBX\modules\Clearlysp\CIP\ClearlyMiddleware-&gt;__invoke()
                                 #9 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
                                 #10 [internal function]: Slim\DeferredCallable-&gt;__invoke()
                                 #11 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
                                 #12 /var/www/html/admin/modules/clearlysp/CIP/ClearlyAuthMiddleware.php(7): Slim\App-&gt;Slim\{closure}()
                                 #13 [internal function]: FreePBX\modules\Clearlysp\CIP\ClearlyAuthMiddleware-&gt;__invoke()
                                 #14 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
                                 #15 [internal function]: Slim\DeferredCallable-&gt;__invoke()
                                 #16 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
                                 #17 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App-&gt;Slim\{closure}()
                                 #18 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/App.php(392): Slim\App-&gt;callMiddlewareStack()
                                 #19 /var/www/html/admin/modules/clearlysp/vendor/slim/slim/Slim/App.php(297): Slim\App-&gt;process()
                                 #20 /var/www/html/admin/modules/clearlysp/CIP/ClearlyAPI.php(7): Slim\App-&gt;run()
                                 #21 /var/www/html/admin/modules/clearlysp/Clearlysp.class.php(7): FreePBX\modules\Clearlysp\CIP\ClearlyAPI-&gt;handleRest()
                                 #22 /var/www/html/admin/libraries/BMO/Ajax.class.php(127): FreePBX\modules\Clearlysp-&gt;ajaxCustomHandler()
                                 #23 /var/www/html/admin/ajax.php(63): FreePBX\Ajax-&gt;doRequest()
                                 #24 /var/www/html/admin/api/api.php(3): include('/var/www/html/a...')
                                 #25 {main}</pre><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v84a3a4012de94ce1a686ba8c167c359c1696973893317" integrity="sha512-euoFGowhlaLqXsPWQ48qSkBSCFs3DPRyiwVu3FjR96cMPx+Fr+gpWRhIafcHwqwCqWS42RZhIudOvEI+Ckf6MA==" data-cf-beacon='{"rayId":"85806017cb5f236b","version":"2024.2.0","token":"a306721cac6c4423a2400363189596d6"}' crossorigin="anonymous"></script>
                                 </body></html>```

So looking at the code there should be more debugging information available on this. I have done a little digging and am curious if we can help get a better answer or some direction on this. Can you get back in touch with our support and have them push the issue to Bryan so he can poke around and perhaps get a better direction.

Just setup with voip.ms i can send sms but not receive any ideas ?

@hardocp for reference as you work through the support ticket with CIP - I have (previously, and just now) tested flowroute working with UCP, Sangoma Talk (mobile) and Sangoma Desktop. No errors thrown from the clients or in the FreePBX logs.

I don’t know whether this could have anything to do with it, but please confirm you have not set Flowroute to send delivery receipts to your webhook.

Not without logs or really any details at all…

For voip.ms this is enough on providers end?


There is no need to link SMS received to this DID to a SIP Account ?

Where can i see the logs to see what is going wrong on Freepbx ?

Thanks

1 Like

This is all I have for now: New open source SMS Connector module - #99 by billsimon

I know there is a need for some documentation and when I get some time I’ll work on the wiki.

Logs related to the module are posted in /var/log/asterisk/freepbx.log

I am able to send messages throught voip.ms but can’t recive them this is all I got in the logs…

[2024-03-05 15:54:11] [freepbx.INFO]: Deprecated way to add Console commands for module sangomartapi, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
[2024-03-05 15:54:11] [freepbx.INFO]: Deprecated way to add Console commands for module voicemail, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
[2024-03-05 15:54:15] [freepbx.INFO]: Webhook (voipms) in: Array (     [provider] => voipms     [to] => {TO}     [from] => {FROM}     [message] => {MESSAGE}     [id] => {ID}     [date] => {TIMESTAMP}     [media] => {MEDIA} )  [] []
[2024-03-05 15:54:15] [freepbx.INFO]: Exception Webhook (voipms): file_get_contents({MEDIA}): failed to open stream: No such file or directory [] []
[2024-03-05 15:55:02] [freepbx.INFO]: Deprecated way to add Console commands for module api, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
[2024-03-05 15:55:02] [freepbx.INFO]: Deprecated way to add Console commands for module backup, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
[2024-03-05 15:55:02] [freepbx.INFO]: Deprecated way to add Console commands for module pbxmfa, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
[2024-03-05 15:55:02] [freepbx.INFO]: Deprecated way to add Console commands for module sangomartapi, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
[2024-03-05 16:15:06] [freepbx.INFO]: Deprecated way to add Console commands for module voicemail, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
[2024-03-05 16:15:10] [freepbx.INFO]: voipms responds: HTTP 200, {"status":"success","sms":75563905} [] []
[2024-03-05 16:15:28] [freepbx.INFO]: Deprecated way to add Console commands for module api, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []

The incoming messages are still showing on the voipms SMS/MMS Message Center Information

Thanks

Grillo

Check your webhook; looks like the variables are not being substituted as they should be.

This is what i have there:

https://freepbx.xxx/smsconn/provider.php?provider=voipms;to={TO};from={FROM};message={MESSAGE};id={ID};date={TIMESTAMP};media={MEDIA})

In Freepbx and in voip.ms

screen

Looks like you have a ) at the end of the url. That should not be there.

Thanks @billsimon I removed the ) but still the same issue can send message but not receive , nothing on the logs… :thinking: