- Thank you received: 0
keywords: ip pbx voip gateway gsm gateway
[from-gsm]
******receiing calls**************
exten =>s,1,NoOp(You have an incoming call!)
exten =>s,2,Answer()
exten =>s,3,Playback(demo-instruct)
exten =>s,4,Goto(3)
******end of receiing calls*******
******receiving sms**************
exten =>sms,1,NoOp(You receive a sms!!!)
exten =>sms,2,Verbose(${SMSSRC})
exten =>sms,3,Verbose(${SMSTXT})
exten =>sms,n,ForwardSMS(2,13714489316,12345)
******end of receiving sms*******
*******sending sms(OK)***************
exten => sms_send_ok,1,NoOp(Your sms has been sending!!!)
exten => sms_send_ok,n,Verbose(${SMS_SEND_ID})
exten => sms_send_ok,n,System("echo OK >/var/tmp/${SMS_SEND_ID}")
*******end of sending sms(OK)********
*******sending sms(Not_OK)***************
exten => sms_send_failed,1,NoOp(sms sending failed!!!)
exten => sms_send_failed,n,Verbose(${SMS_SEND_ID})
exten => sms_send_failed,n,System("echo FILED >/var/tmp/${SMS_SEND_ID}")
*******end of sending sms(Not_OK)********
Step 2: Sending SMS over Asterisk CLI
Once you get the extensions.conf done, then starting Asterisk by asterisk -vvvvgc
A: type "gsm show spans" to check if the spans have been ready for sending sms.
If you got information UP for each span, which means you get them ready. If not, please
be sure that you serve power to the GSM card(Regarding how to,please read our G400P/E manual for more).
Meanwhile, you can see the dmesg info when starting Asterisk. Normally, the system will receive "OK" from GSM modem to tell you the GSM modem is ready.
B: type "gsm set send sms mode" to set which mode you want, pdu and text are supported so far.
C: type "gsm set debug file ". e.g "gsm set debug file >>/var/tmp/gsm_sms_debug.txt". This uses to check the AT flows during sending SMS.
D: type "gsm send sms X", e.g "gsm send sms 8 15623841265 "Hello, my friend!" No.1"
E: If you sent the sms successfully, you will get something like "Send SMS to 15623841265 on span 8 at 11:20:37"
Step 3: Sending SMS over script.
OpenVox GSM supports sending SMS over script. All what you can do is generate the sending script with your favorite language.
Here is a sample shell script for sending.
sending sms over bash shell
#!/bin/bash
#This shell uses to sending sms!
#Author:[email protected]
#Destination Number
DENO=15623841265
#SMS Contents
SMS="Hello chan_extra-2.0.5!!!"
for (( i = 0; i <= 5; i++ )) do
asterisk -rx "gsm send sms 8 $DENO \"$SMS\" $i"
echo $i
done
end of the bash shell
Of course, you can extend your own better features here.