simontelephonics / smsconnector

SMS Connector module for FreePBX 16 and 17
https://simon.tel/open-source/
GNU General Public License v3.0
43 stars 16 forks source link

How to configure SMS (SMS Connector) with Twilio in FreePBX? #52

Closed Simoon-F closed 3 months ago

Simoon-F commented 3 months ago

Hello.

I installed SMS Connector and set up Twilio configuration in Provider Settings.

Then added Number in List Numbers page, DID: 1 Users: selected 3 test numbers 1000, 1010, 1011 Provider: selected Twilio

According to the documentation, I also configured https and changed the DNS from IP access to domain name access. Do I need to copy the certificate file to the server and then set the HTTPS TLS Certificate Location and HTTPS TLS Private Key Location?

“Allow your provider(s) webhook addresses through the FreePBX Firewall and/or your network firewall”

I have already set the port to open.

“Set the public DNS name in the AMPWEBADDRESS setting: Advanced Settings → FreePBX Web Address”

Here I also set voip.xxx.com.

Have I completed the configuration here? When I saw the description in the document: “Sending of SMS/MMS requires verification and registration performed through your provider and is outside of the scope of this module or document.”

I didn’t find where to set up Twilio’s WebHook, but I found Twilio’s SID and Token.

Then I tested it on linphone and found that a red exclamation mark would appear directly in the lower right corner of the sent text. I don’t know where else I need to configure.

image

Do I need to configure Trunks to use SMS?

Version: FreePBX 17.0.19.1

Thanks~!

Simoon-F commented 3 months ago

I have configured Trunks to make outgoing calls, but I still have no idea how to send SMS messages.

billsimon commented 3 months ago

Please first test using the SMS widget in UCP: log in to UCP with one of the users you configured (1000, 1010, 1011) and add the SMS number to the dashboard. Once you confirm it is working in UCP then try with the SIP client. Logging including any error messages will be in /var/log/asterisk/freepbx.log

image

Simoon-F commented 3 months ago

@billsimon Thanks~

I encountered some new problems.

I saw in freepbx.log:

[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 [] [] 

[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 [] []  

[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 [] []  

[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 [] []    

[freepbx.INFO]: Deprecated way to add Console commands for module vmnotify, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []

[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 [] []

[freepbx.INFO]: [NOTIFICATION]-[freepbx]-[FW_TAMPERED] - You have 2 tampered files (Module "SMS Connector" signed by an invalid key.<br>Module: "SMS Connector", File: "module.sig check failed! Signed by unknown, untrusted key.") [] []

Does this mean that the https certificate file I configured needs to be stored in the server, and that I need to modify these two items in HTTPS TLS Certificate Location and HTTPS TLS Private Key Location on the Advanced Settings page?

Simoon-F commented 3 months ago

I seem to have solved it successfully, but it will keep prompting this. I'm not sure if this will affect my next operation, but I will continue to try.

image

Simoon-F commented 3 months ago

I can now receive and send messages in the SMS module of UCP, and I am trying to implement this function on linphone.

But I found that linphone seems to be in sip format and does not support twilio. Of course, this is just my current guess and I am still exploring.

In addition, I would like to ask, is there any software that can call and support twilio to send messages through sip tools?

Thanks~ @billsimon

billsimon commented 3 months ago

For SIP clients, we have successfully tested Zoiper desktop and mobile, Fanvil and Sangoma (S-series) hardphones, and Acrobits Groundwire. I played with Linphone but did not see success receiving messages to the phone. I am sure other phones may work also but we do not have a lot available to test. SIP standard phones that implement SIP MESSAGE for messaging and use only text/plain format should work fine.