https://github.com/vaestvita/freepbx_sms_notifications
Sending SMS notifications from your FreePBX server via SMS gateway (Goip SMS server, MacroDroid (Android))
Capabilities:
- Sending an SMS business card to your clients after a call (card.txt)
- sending a notification of a missed call to the operator (to the mobile number specified in findmefollow) (notify.txt)
- send the client number after calling the operator on the mobile phone (answered.txt)
Installation and configuration
- copy files to folder /var/lib/asterisk/agi-bin/sms
- go to /var/lib/asterisk/agi-bin/
- chown asterisk:asterisk -R /sms
- add code to the end of the file extensions_custom.conf
- Submit, Apply Config
- Enter the address of your SMS gateway in the url field ($url = '')
SMS notifications after the call will be sent according to the matching scenario if there is SMS text in the corresponding file (card.txt, notify.txt, answered.txt)
- if you want to send an SMS business card for all clients who called the extension number 100, make a record in the file card.txt similar to this: "100;Thank you for your call. Visit our website: example.com"
- if you want to send an SMS notification to an operator with extension number 100 to his mobile (which is specified in the follow me module) about a missed call, create an entry in the file notify.txt similar to: "100;Missed call"
- If you want to send an SMS notification with the client's number to the operator who received the call on his mobile phone, create a corresponding entry in the file answered.txt: "100;Now call"
- disable this parameter in "System Manage": "Save message before sending (browser should support javascript)" (/goip/en/sys.php)
- Install the app MacroDroid (https://play.google.com/store/apps/details?id=com.arlosoft.macrodroid)
- Create a new macro
- Use a webhook as a trigger
- Copy the received address to a file sms.php, $url = 'https://trigger.macrodroid.com/xxxxxxxxx-xxxxxxx-xxxxxx/smsgate'; //sms gateway address)
- Create a local variables (memo, smsnum)
- create actions "Messaging - Send SMS"
- in the field "phone number" insert local variable "smsnum" ([v=smsnum]
- in the field "Message text" insert local variable "Memo" ([v=memo])
- save and enable your macro
If you know how to improve this script - make a request, I will be glad for your help.