keywords: ip pbx voip gateway gsm gateway

×

Notice

The forum is in read only mode.
× Questions about G400/G410 Cards.

how to send sms over GSM card?

11 years 10 months ago #8135 by Joe.Yung
This thread aims to teach you how to send sms over OpenVox GSM cards.
There are a few steps you need to configure before sending/receiving sms.

Step 1: Setting up extensions.conf in /etc/asterisk/
sample:

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


10 years 11 months ago #8837 by cypriotxx
Hi There
how can we get delivery report status showing or where we can see in logs please ?
we would like to receive delivery reports for the sms sent .


here what we see

Send SMS to [url=tel:447531581059]447531581059[/url] on span 2 at 11:33:45
2:<<< 0 AT+CMGF=0 -- OK , 2
2:<<< 0 AT+CSCS="UCS2" -- OK , 2
2:<<< 0 AT+CMGS=45 -- > , 2
2:<<< 0 -- +CMGS: 89 , 9
2:<<< 0 -- +CMT: "",51 , 11
SMS PDU = 0791449785788997640C914457138501950008315013113394402005000367010100540065007300740020006D006500730073006100670065000A
User Data Header Indicator = 1
SMSC Length = 7
SMSC Type-of-address = 0x91
SMSC Number = +447958879879
PDU First Octet = 0x64
Sender number length = 12
Sender Type-of-address = 0x91
Sender Number = +447531581059
TP-PID = 0
TP-DCS = 0x8
Timestamp = 13053111334904
User data length = 32
User data = 05000367010100540065007300740020006D006500730073006100670065000A
User data 8bit =
this is the only thing we see and we cant see the report you meant
here for Status!




Thank you so much
Regards
Bill
Time to create page: 0.028 seconds
Powered by Kunena Forum