# Asterisk Project : Mobile Channel SMS Sending and Receiving

Added by mdavenport , edited by mdavenport on Aug 31, 2010

If Asterisk has detected your mobile phone is capable of SMS via bluetooth, you will be able to send and receive SMS.

Incoming SMS's cause Asterisk to create an inbound call to the context you defined in mobile.conf or the default context if you did not define one. The call will start at extension 'sms'. Two channel variables will be available, SMSSRC = the number of the originator of the SMS and SMSTXT which is the text of the SMS. This is not a voice call, so grab the values of the variables and hang the call up.

So, to handle incoming SMS's, do something like the following in your dialplan

    [incoming-mobile]
    exten => sms,1,Verbose(Incoming SMS from ${SMSSRC} ${SMSTXT})
    exten => sms,n,Hangup()

The above will just print the message on the console.

If you use res_jabber, you could do something like this :-

    [incoming-mobile]
    exten => sms,1,JabberSend(transport,user@jabber.somewhere.com,SMS from ${SMSRC} ${SMSTXT})
    exten => sms,2,Hangup()

To send an SMS, use the application MobileSendSMS like the following :-

    exten => 99,1,MobileSendSMS(dave,0427123456,Hello World)

This will send 'Hello World' via device 'dave' to '0427123456'