Send SMS form chan_dongle module

I`m trying config to send SMS from SIP chat to GSM phone

I`ve added to dialplan this string
same => n,DongleSendSMS(dongle0, +37xxxxxx, test, 1440, yes)

when try executing this asterisk cli writes
– Executing [58866696@send-sms:4] NoOp(“Message/ast_msg_queue”, “Body hhj”) in new stack
– Executing [58866696@send-sms:5] Set(“Message/ast_msg_queue”, “SMSTO=sip:xxx”) in new stack
– Executing [58866696@send-sms:6] DongleSendSMS(“Message/ast_msg_queue”, “dongle0, +37xxxx, test, 1440, yes”) in new stack
[2016-08-01 12:34:34] ERROR[1815][C-00000005]: app.c:113 app_send_sms_exec: [dongle0] Invalid destination number with id 0xb6601da4

what is wrong. Where i can view log what is located under id 0xb6601da4?

exten => _X.,1,Dial(Dongle/g0/${EXTEN},60,tT)
exten => _X.,1,Dial(Dongle/dongle0/${EXTEN},60,tT)

In CLI=> dongle sms dongle0 +556146363473673 Hello

This two doesn`t works at all

CLI were worked, but i need send sms from sip chat

Use the shell or system function!

exten => _X,1,System(sh asterisk -rx ‘dongle sms dongle0 +556146363473673 Hello’)


exten => _X,1,Set(msg=${SHELL(sh asterisk -rx ‘dongle sms dongle0 +556146363473673 Hello’)})

many thanks. Works now!

one more question Asterisk have MessageSend application with syntax (to, from).
In which format i must write from field that reciept will receive message form for example number 12345678?

Use variables!

exten => _X,1,System(sh asterisk -rx 'dongle sms dongle0 $telephone $msg ')


exten => _X,1,Set(msg=${SHELL(sh asterisk -rx 'dongle sms dongle0 $telephone $msg ')})

Thank you for your support

I’m already used this:
exten => _X,1,System(sh asterisk -rx 'dongle sms dongle0 $telephone $msg ')

but when i send message from sip chat i get this:
Executing [01025330104@astsms:1] System(“Message/ast_msg_queue”, “sh asterisk -rx 'dongle sms dongle0 $telephone $msg '”) in new stack
– Auto fallthrough, channel ‘Message/ast_msg_queue’ status is ‘UNKNOWN’

01025330104 this is the mobile phone number i would like to send sms to it

Thanks in advance!

What do you expect to get. I don’t see anything going wrong here.

Did you expect $telephone and $msg to be expanded by Asterisk, before the System call? If so, you have the wrong syntax for variable substitution.

1 Like

Sorry i’m a newbie so i did not get your point, so can you tell me what is the wrong with this code?


Nothing is necessarily wrong with the code. Without knowing what it is supposed to do, it is not possible to say why it is not doing it.

1 Like

Dear Momen,

I am a newbee too. I have installed asterisk freepbx to my Raspberry Pi 3 and I am using a Huawei dongle for my mobile phone sim card. I have managed to make things work and using as a voip phone succesfully. But I am trying to do the same thing as you tried to do as well like sending and receiving SMS through Groundwire SIP Chat.

Where should I start? Is there a tutorial? I have read the conversation above but can not figure out where to edit, or write these commands.

Many thank you in advance