I am using a file /etc/asterisk/extensions_custom.conf
to send me a received SMS (SMS received by USB dongle). The content of a file is:
[from-trunk-dongle]
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,System(echo "To: [email protected]\nSubject: Incoming SMS from ${CALLERID(num)}\n\nOn ${STRFTIME(${EPOCH},,%d. %m. %Y at %H:%M:%S)} you received SMS from number ${CALLERID(num)}.\n\nSMS content:\n " > /tmp/sms.txt)
exten => sms,n,Set(FILE(/tmp/sms.txt,,,a)=${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,System(sendmail -t < /tmp/sms.txt)
exten => sms,n,Hangup()
exten => _.,1,Set(CALLERID(name)=${CALLERID(num)})
exten => _.,n,Goto(from-trunk,${EXTEN},1)
No, I want this SMS to be sent to my Signal number via Signal API. (Signal is a secure messenger.) In terminal I can write this command:
echo "{\"message\": \"On $(date '+%m. %d. %Y at %H:%M:%S') you have received SMS message.\", \"number\": \"+XXXXXXXXXXX\", \"recipients\": [\"+YYYYYYYYYYY\"]}" | /usr/bin/curl --user 'user:password' -X POST -H "Content-Type: application/json" -d @- 'https://signalapi.myserver.net/v2/send'
This works, but from the terminal only. If I put this into the /etc/asterisk/extensions_custom.conf
(after the line starting with exten => sms,1,Verbose
, I do not receive any Signal message.
Any idea what could be a problem?