Bayham's Asterisk SMS Gateway is a worldwide solution for SMS messaging on the Asterisk PBX. It is a replacement for the outbound SMS functionality provided in the standard Asterisk build, delivering an efficient and low-cost way of sending text messages from an Asterisk PBX to mobile phones in 165 countries. Applications include voicemail notifications, missed call alerts, automated text receipts for callers (e.g. call reference number), system alerts, and a multitude of other uses.
In a nutshell the key features are:
- Worldwide SMS capability
- Dynamically set Sender ID to anything you like (including alphabetical strings!)
- High message throughput
- Internet based (doesn't use any valuable PRI resources)
- MWI Support
|
|
News
3 December, 2007: Due to persistent fraud by a number of people, messages to Nigeria will no longer be sent by default,
but you will still be charged credits as though they were sent.
Dispatch can be turned on, on an account-by-account basis, by sending a request to our support dept.
We will consider each request based on a history of non-fraudulent payment, and may refuse until such a history is available.
We will also change your account settings so that each future purchase must be manually confirmed before allocation to your account, without exception.
We apologise for the inconvenience that this may cause to those customers who make perfectly reasonable use of their accounts, and will
endeavour to process their requests as soon as possible.
This change is also detailed on our Network List.
26 January, 2007: A new voicemail notification example dialplan has been added which prevents the FastSMS script
being called if no new voicemail has been left for a user. Our thanks to FastSMS user Tasis Michalakopoulos for kindly submitting this example.
18 January, 2006: We have added support for Asterisk 1.2.x into the FastSMS C module. You can download the new
version here.
30 March, 2005: We have added support for MWI (Message Waiting Indicator). Check the example configurations
for more information.
15 March, 2005: Service is now fully live! Beta account holders should check these
special instructions.
14 March, 2005: We've added 133 new mobile operators, spanning our existing global footprint, but also opening-up
SMS delivery for the first time to 30 newly added countries and regions. See the Network List for details. |
What is Asterisk? Asterisk is a complete, highly featured PBX built in software. It runs on Linux, is developed under the open-source model and provides all of the features you would expect from a PBX and more. Asterisk does voice over IP in three protocols, and can interoperate with almost all standards-based telephony equipment using very cost-effective hardware. For more information or to download Asterisk itself go to www.asterisk.org.
What does the Bayham Asterisk SMS Gateway do?
Text messages generated by Asterisk are sent over the Internet to Bayham's Asterisk SMS Gateway where they are then encoded for delivery to the mobile network. There are two main components to the Bayham solution:
- A small module that you run locally on your Asterisk PBX (available either as a Perl script that uses the AGI interface, or a 'C' module that adds a new app to your Asterisk build. When installed, you can invoke the FASTSMS command within any dialplan to send text messages.
- A remote gateway that is managed and hosted by Bayham which accepts messages from your Asterisk server, validates the parameters passed by your dialplan, and then injects these into the PLMN (Public Land Mobile Network - the mobile equivalent of the PSTN). The gateway also determines the best point to hand your message over to the PLMN (we connect into several carriers) in order to ensure a reliable and cost-effective route to your chosen endpoint.
How does the Bayham solution compare with the SMS command built-in to Asterisk?
The key differences between the Bayham solution and the SMS command already available in Asterisk can be summarised as follows:
|
Standard Asterisk SMS Command |
Bayham FASTSMS Command |
Method used to transmit text message to network |
SMS Data is transmitted via the ISDN / PSTN on the physical layer using 1200 Baud FSK modulation within a traditional voice-band call. This analog leg is terminated by the ISDN / PSTN carrier (if they support SMS) and then passed to their SMS-C for routing into the PLMN. |
FASTSMS command efficiently transmits SMS via the Internet to the Bayham SMS Gateway. From here the gateway determines the optimum point to inject the message into the PLMN. It is then routed to the destination mobile network. |
Countries in which Asterisk can originate text messages |
6 countries only (UK, Ireland, Germany, Israel, Belgium, France). Major Asterisk markets such as USA and Canada are notably absent. |
Any, since FASTSMS messages are sent from Asterisk to the Bayham gateway via the Internet |
Carriers through which Asterisk can originate text messages |
Only one per supported country (typically the incumbent operator, e.g. BT for the UK market) |
FASTSMS does not require connectivity via the PSTN so your choice of carrier(s) does not have any bearing on your ability to send text messages |
Mobile networks that will accept messages sent from Asterisk |
Mileage varies dependent on originating carrier but is generally restricted to mobile networks in the home country (this is true for BT Text). |
471 mobile networks based in 165 countries, plus some satellite mobiles. See the full list here. It doesn't matter from where the message was sent, it can always be delivered to mobile phones on any of these networks. |
Control over the SMS Sender-ID |
Limited to DID / DDI available on the ISDN link. |
Dynamically set by you to whatever you like, numerical or alphabetical (e.g. direct dial number for extension, or name of your company). Note: a handful of networks are currently blocking this feature although it works on most. |
Message throughput |
Technically throughput is limited to about 1 SMS per 10 seconds (unless multiple circuits are utilised). Some carriers are imposing additional restrictions. |
100 messages per second |
Impact on channel dimensioning |
SMS transmission occupies a line and so must be factored in to any E1 / T1 dimensioning. |
SMS transmission only requires a very low bandwidth Internet connection |
Cost |
Depends on carrier (BT charges UK customers £0.10 per message) |
Typically much cheaper than the per message cost charged by a carrier. Actual price depends on the number of messages you pre-pay for and the destination of the message.
See Pricing Information.
|
Restrictions to usage |
Dependent on carrier's terms (BT limits usage to 100 messages per day and forbids "computer generated texts" and telemarketing) |
We only forbid spamming and unlawful usage. |
It should be noted that the Bayham solution only supports the transmission of SMS from Asterisk and not reception at the present time. It is therefore only a partial replacement to the built-in SMS command. A future release may also introduce some receive capabilities. The FASTSMS command can work in conjunction with the existing SMS command, combining the receive capabilities of the SMS command with the enhanced sending capabilities of FASTSMS.
Example Usage Scenarios
Since FASTSMS is a generic command for sending text messages from wihin a dialplan its applications are broad and varied and down to the individual Asterisk administrator to determine the exact form. However, here are some provided examples to help stimulate your own ideas about how to integrate SMS technology into your Asterisk PBX:
Voicemail Notification |
When a voicemail has been left for a particular extension an SMS is sent to the mobile phone associated with that extension user. The SMS details when the voicemail was left, the caller's number and the voicemail access number.
Example dialplan:
Note: In this example 44765123456 is the number of the mobile, and 44123456000 is the voicemail access number.
Perl AGI Version
...
exten => 100,3,VoiceMail(u${EXTEN})
exten => 100,4,HasNewVoiceMail(${EXTEN})
exten => 100,6,goto(110)
exten => 100,105,AGI(fastsms | 44765123456 | MWIVOICEMAILON | 44123456000)
exten => 100,106,AGI(fastsms | 44765123456 | Caller ${CALLERID} left a new voice mail at ${DATETIME} | 44123456000)
exten => 100,110,Hangup
... |
'C' App Version
...
exten => 100,3,VoiceMail(u${EXTEN})
exten => 100,4,HasNewVoiceMail(${EXTEN})
exten => 100,6,goto(110)
exten => 100,105,FastSMS( 44765123456 | MWIVOICEMAILON | 44123456000)
exten => 100,106,FastSMS( 44765123456 | Caller ${CALLERID} left a new voice mail at ${DATETIME} | 44123456000)
exten => 100,110,Hangup
... |
Improved 'C' App Version
Kindly submitted by FastSMS user Tasis Michalakopoulos from Athens, Greece.
This dialplan example works by comparing the number of voicemails in a users voicemail box before and after a call completes. On call hangup the FastSMS script is then only called if a new voicemail has been left for the user.
...
exten => s,1,Set(MSGSbefore=${VMCOUNT(123)})
exten => s,2,Dial(Zap/1,20,r)
exten => s,3,VoiceMail(u123@default)
exten => s,4,Hangup( )
exten => h,1,Set(MSGSafter=${VMCOUNT(123)})
exten => h,2,GotoIf($["${MSGSbefore}" = "${MSGSafter}"]?4)
exten => h,3,FastSMS(|New voicemail from ${CALLERID} at ${DATETIME}|)
exten => h,4,SoftHangup(Zap/1,a)
... |
Example dialplan: How to clear the MWI when retrieving voicemail.
Perl AGI Version
...
exten => 100,3,VoiceMailMain(s${CALLERIDNUM})
exten => 100,4,HasNewVoiceMail(${CALLERIDNUM})
exten => 100,5,AGI(fastsms | 44765123456 | MWIVOICEMAILOFF| 44123456000)
exten => 100,105,Hangup
... |
'C' App Version
...
exten => 100,3,VoiceMailMain(s${CALLERIDNUM})
exten => 100,4,HasNewVoiceMail(${CALLERIDNUM})
exten => 100,5,FastSMS( 44765123456 | MWIVOICEMAILOFF| 44123456000)
exten => 100,105,Hangup
... |
|
Missed Call Alert |
If a call was not answered and the caller did not leave a voicemail then a missed call alert containing the caller's number is sent as an SMS to the extension user's mobile.
Example dialplan:
Perl AGI Version
...
exten => 100,3,VoiceMail(u${EXTEN})
exten => 100,4,HasNewVoiceMail(${EXTEN})
exten => 100,5,AGI(fastsms | 44765123456 | Missed call alert ${CALLERID} called at ${DATETIME} |$(CALLERID))
exten => 100,110,Hangup
...
|
'C' App Version
...
exten => 100,3,VoiceMail(u${EXTEN})
exten => 100,4,HasNewVoiceMail(${EXTEN})
exten => 100,5,FastSMS(44765123456 | Missed call alert ${CALLERID} called at ${DATETIME} |$(CALLERID))
exten => 100,110,Hangup
... |
|
Call Reference Receipt |
When the caller hangs up a unique reference number is sent to their mobile phone. This can be integrated with a query tracking / CRM system to allow the caller to reference their case at a later stage.
Example dialplan:
Perl AGI Version
...
exten => 100,uniquecallref,AGI(getuniquecallref)
exten => 100,4,AGI(fastsms | ${CALLERID} | Your call reference is ${UNIQUECALLREF})
exten => 100,5,Playback(goodbye)
exten => 100,6,Hangup
... |
'C' App Version
...
exten => 100,uniquecallref,AGI(getuniquecallref)
exten => 100,4,FastSMS( ${CALLERID} | Your call reference is ${UNIQUECALLREF})
exten => 100,5,Playback(goodbye)
exten => 100,6,Hangup
... |
|
Prompt Driven Texting Tool |
In this example scenario a car manufacturer provisions a service for its dealerships and service centres to dial-in to a voice prompt where they can create a text message from a selection of templates which can then be transmitted to one or more customers. This could include reminding customers of their test drive appointment (and not to forget to bring their license), or that their newly serviced car is ready to collect.
Example dialplan:
|
Text Sending from VoIP Phone |
Some of the more advanced VoIP phones on the market provide a text / instant message origination feature and / or an XML browser (which can also be used to generate text messages or select messages from a menu of standard templates). FASTSMS can be used to route these messages out to external mobile devices.
Example dialplan:
TBC |
Administrator Alerts |
Administrators can write scripts to monitor certain system parameters and then generate SMS alarms if they cross a specific threshold. Such parameters could include CPU loading, Asterisk line utilisation, or serious system errors.
Example dialplan:
TBC |
Installation and Usage Instructions
To make use of our Asterisk SMS Gateway, you will need to install a small module into your Asterisk server.
There are two solutions available at present, a Perl script that uses the AGI interface in Asterisk, or a 'C' program that adds a new 'app' to Asterisk.
The choice as to which one you use is up to you (if you don't have a preference we would recommend you use the 'C' version).
Installing the 'C' app Version (Recommended)
- Sign-up for a (free) account
- Download asterisk-fastsmsapp.tar
- Unpack the tar-file. It will untar into a directory called asterisk-fastsmsapp
- Copy 'app_fastsms.c' into asterisk-1.0.5/apps
- Apply 'makefile.patch' to the Makefile in asterisk-1.0.5/apps, by doing:
$ patch Makefile makefile.patch
- Go to the asterisk-1.0.5 directory and do 'make' and 'make install'
- Copy 'fastsms.conf' into /etc/asterisk, edit it, and set the 3 account parameters which you can get from the My Account section.
- Add rules to extension definitions to use the new app. (See example below)
- Start asterisk
- Test it!
Example Usage
exten => s,2,FastSMS(44123456789|Hello World)
The parameters supplied to the module are as follows and are specified in the order listed: Destination (Required):
The number to which the SMS message should be sent. The country code must be included here for the message to be accepted.
Message Text (Required):
The text of the SMS to be sent. This is currently limited to 160 characters and any message longer than this limit will be truncated.
The MWI (Message Waiting Indicator) can be set/cleared by setting the Message Text parameter to one of the following values:-
- MWIVOICEMAILON
- MWIVOICEMAILOFF
- MWIFAXON
- MWIFAXOFF
- MWIEMAILON
- MWIEMAILOFF
- MWIOTHERON
- MWIOTHEROFF
There are four MWIs specified in GSM, VoiceMail,Fax,Email and Other. What actually happens when you set/clear each one is very dependent on the mobile phone model. For example in response to the VoiceMail indicator being set, older phone models often direct the user to their mobile operators voicemail system, ie. using the voicemail access number that is stored in the phone. Some newer models use the senderid that was included in the MWI message, as the voicemail access number.
Sender Id. (Optional)
The identity of the sender, this is limited to 11 chars. If you set it to a number the receiving mobile will use that as the reply to number.
The FASTSMS module will log any problems in the verbose log of asterisk.
Installing the Perl AGI Version
This alternative implementation enables you to connect with our SMS Gateway via the Asterisk AGI interface. The module itself takes parameters from the AGI command and a configuration file and sends the SMS via the Bayham Systems SMS gateway. This alternative to the 'C' app is only recommended if you prefer to use the AGI interface instead of adding a new command into Asterisk itself.
- Start by installing the Asterisk Perl module if you dont have it already.
- Sign-up for a (free) account
- Download asterisk-fastsmsperl.tar
- Download it and untar the archive:
$ tar xvf asterisk-fastsmsperl.tar
- Open the FastSMS directory:
$ cd asterisk-fastsmsperl
- Copy the FastSMS script into your AGI directory:
$ cp fastsms /var/lib/asterisk/agi-bin
- Edit the 'fastsms' Perl script and modify the companyId, userId & password to the values displayed in My Account.
- Add rules to extension definitions to make the AGI call.
- Once you've completed these steps FASTSMS is installed and ready to go.
Example:
exten => 100,5,AGI(fastsms|4412345678901|Caller ${CALLERID} left a new voice mail at ${DATETIME}|Asterisk)
The parameters supplied to the module are as follows:
msisdn (Required):
The msisdn (mobile phone number) to which the SMS message should be sent. The country code must be included here for the message to be accepted.
messageText (Required):
The text of the SMS to be sent. This is currently limited to 160 characters and any message longer than this limit will be truncated.
The MWI (Message Waiting Indicator) can be set/cleared by setting the Message Text parameter to one of the following values:-
- MWIVOICEMAILON
- MWIVOICEMAILOFF
- MWIFAXON
- MWIFAXOFF
- MWIEMAILON
- MWIEMAILOFF
- MWIOTHERON
- MWIOTHEROFF
There are four MWIs specified in GSM, VoiceMail,Fax,Email and Other. What actually happens when you set/clear each one is very dependent on the mobile phone model. For example in response to the VoiceMail indicator being set, older phone models often direct the user to their mobile operators voicemail system, ie. using the voicemail access number that is stored in the phone. Some newer models use the senderid that was included in the MWI message, as the voicemail access number.
smsSenderId (Optional):
An alphanumeric string up to 11 characters long which will be used as the sender id for the SMS. Any string longer than 11 characters will be truncated.
The FASTSMS module will log any problems in the verbose log of asterisk. |