[Asterisk-Users] SMS - how to send one

Stefan Reuter asterisk at stefan.de
Mon Dec 20 00:41:04 MST 2004


> I realize that the most interesting aspect for some is to talk back
> and forth between phone and asterisk on the local server which is
> "nice" too.

yes i almost forgot about that one. app_sms can also act as a message
center itself: so if you connect some sms capable fixed line phone to
asterisk you can send sms messages to and receive messages from that
phone.

> I second the request for some config info. I've read everything I
> could find on this and it wasn't enough. I'm still missing some basic
> concept.

ok. the best resource is probably the wiki 
http://www.voip-info.org/tiki-index.php?page=Asterisk%20cmd%20Sms
- but i am sure you already got that.
I am using asterisk-1.0.2 with the following config:

extensions.conf:

[capi-in]
exten => s/01930100,1,NoOp(incoming sms ${CALLERIDNUM})
exten => s/01930100,2,Answer
exten => s/01930100,3,Wait(2)
exten => s/01930100,4,SMS(default,a)
exten => s/01930100,5,Hangup
...

[smsdial]
exten => _X.,1,SMS(default,,${EXTEN},${MSG})
exten => _X.,2,SMS(default)
exten => _X.,3,Hangup
exten => h,1,Hangup

The [capi-in] context is the context where i send all my incoming calls
from pots to. Based on the callerid (01930100 is the callerid the t-com
message center sends, see list in wiki) incoming sms messages are
detected and send to app_sms in answer mode. (Note the wait(2) which is
really needed in order to allow the message center to catch up)

The [smsdial] context is used for sending outgoing sms messages.
To send messages i am using a small perl script that places a .call file
into /var/spool/asterisk/outgoing with the following content:

Channel: CAPI/<MY MSN>:b<NUMBER OF MESSAGE CENTER, i.e. 0193010>
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: smsdial
Extension: <MOBILE NUMBER>
Priority: 1
SetVar: MSG=<MESSAGE TO SEND>

You will find the perl script attached but be warned it is not ready for
production as it doesn't do any input validation!

> I will be asking French Telecom to enable SMS on our fixed line today
> (and we'll see if that stops the nice lady from reading "hello world"
> with a French accent) Fixed line SMS has been advertised for at least
> a year here.

Thats what i did here, too. So german telecom knows i dont like that
lady, but any other mobile providers still "talk" to me.

stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mail2sms.pl
Type: application/x-perl
Size: 767 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20041220/cf533154/mail2sms.bin


More information about the asterisk-users mailing list