You can handle received SMS and USSD using
Example for received sms
Always define
sms
and ussd
exten, respectively.Example for received sms
[dongle-incoming-sms] exten => sms,1,Noop(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})}) exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})}' >> /var/log/asterisk/sms.txt) exten => sms,n,Hangup()Example for received USSD
[dongle-incoming-ussd] exten => ussd,1,Noop(Incoming USSD: ${BASE64_DECODE(${USSD_BASE64})}) exten => ussd,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME}: ${BASE64_DECODE(${USSD_BASE64})}' >> /var/log/asterisk/ussd.txt) exten => ussd,n,Hangup()Also note, execution of this exten takes place in a “Local” channel.
Always define
sms
and ussd
extens for context where you handle incoming calls for dongle device! Otherwise, incoming SMS or USSD can execute extensions for voice call with unpredictable results.[dongle-incoming] include => dongle-incoming-sms include => dongle-incoming-ussdAlso note that
h
exten is executed for SMS/USSD just before Local channel is destroyed.
How can we set it up for each dongle separately? Like for each dongle, we set up different settings.
ReplyDelete