hyppoCom - The useless site
22/11/2008 07:04:03
IP: 38.103.63.60

Asterisk app_sms: SMS over PSTN Protocol 2

This patch to app_sms.c is based and tested on Asterisk 1.2.12.1 to 1.2.14.
Asterisk app_sms currently supports SMS over PSTN sms ETSI ES 201 912 protocol 1; this patch adds protocol 2 functionality used by telcos in Italy and Spain.

This patch has been posted to Digium to be integrated in next releases; Digium asked me to have some feedback by users that tried successfully it: to make easier the integration of this patch into official Asterisk distribution tree, please post your feedback to Digium Issue Tracker at this url.

RECEIVING (by Telco and by SMS-enabled handsets)
Dialplan for receiving from telco (this is for italian Telecom Italia):
[pstn-line-in-context]
exten => ...
exten => s,n,GotoIf($["${CALLERID(NUM)}" = "042111"]?sms-in,1) ; Telecom SMSC
exten => ...
exten => sms-in,1,Noop(Incoming SMS on ${CHANNEL} ${CALLERID})
exten => sms-in,n,Answer
exten => sms-in,n,Wait(1) ; Optional
exten => sms-in,n,SMS(smsin|at) ; t is for proto two: couldn't use numbers
exten => sms-in,n,Hangup
Dialplan for receiving from SMS capable handset (italian phones):
[handset-in-context]
exten => 4211,1,Noop(Submit SMS from ${CHANNEL} ${CALLERID})
exten => 4211,n,Answer
exten => 4211,n,SMS(${EXTEN}|ast) ; t for proto2, s for SMSC

SENDING (to Telco and to SMS-enabled handsets)
The SMS send functionality requires or smsq to be patched or my little test batch AST_SMS_TEST.
The patch is necessary to pass the correct argument (t) to SMS application when generating the call; it's really very simple but it's not compatible with protocol 1: it means that, if you apply the patch, your smsq application will always use protocol 2.
To use my simple AST_SMS_TEST, you should edit the batch and change the two variables in the forst lines TELCO_CHAN and PHONE_CHAN.
To see how it works, type AST_SMS_TEST without arguments.
Basically it sends SMS to SMSC (telco's message centre) and to handsets launching SMS application on Asterisk, almost like smsq, but in a very simple way.

TO PATCH
Get the right patch for your Asterisk: 1.2.13 for Asterisk V1.2.10 to V1.2.13 or 1.2.14 for Asterisk V1.2.14
cd /usr/src/asterisk/apps
patch <app_sms_protocol2-1.2.1X.patch
cd ..; make

Download app_sms_protocol2-1.2.13.patch (08/01/2007) 21.958 bytes
Download app_sms_protocol2-1.2.14.patch (08/01/2007) 21.973 bytes
Download smsq.patch (14/12/2006) 581 bytes
Download AST_SMS_TEST (19/12/2006) 2.097 bytes

Page updated: 05/03/2007
Visits: 4611