Resending received SMS (Solved)

Got it…

FreePBX runs my home voip-gsm gateway on Raspberry Pi. I wanted to add two functions that would answer all my needs. They are:

  1. being able to dial a sip-uri set as Misc Destination from any extension.
  2. Resend received sms via chan_dongle.

The first may be a lot complicated so I’ll start with the second.

This dial plan (borrowd from: http://www.raspberry-asterisk.org/calling-on-gsm3g-networks/#comment-4792)receives sms from my two usb dongles and saves them to a file sms.txt:

[from-trunk-dongle]
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,System(echo ‘${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)} – ${DONGLENAME} – ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})}’ >> /var/log/asterisk/sms.txt)
exten => sms,n,Hangup()
exten => _.,1,Set(CALLERID(name)=${CALLERID(num)})
exten => _.,n,Goto(from-trunk,${EXTEN},1)

Since I want to send received sms to my mobile phone, I added this on line 2 of the above:

exten => sms,n,System(asterisk -rx “dongle sms dongle0 +XXXXXXXXXXXX From:${CALLERID(num)} Msg:${BASE64_DECODE(${SMS_BASE64})})”

So from another mobile, I send a message saying “testing 123” to the dongle’s number.

Pertinent log seems to be:

[2013-06-14 13:07:56] VERBOSE[32235][C-00000042] pbx.c: – Executing [[email protected]:2] System(“Local/[email protected];1”, "asterisk -rx “dongle sms dongle0 +XXXXXXXXX5477 From:+XXXXXXXXX4477 Msg:testing 123”) in new stack

But I do not receive the sms.

However when I try:

CLI>dongle sms dongle0 +XXXXXXXXX5477 From:+XXXXXXXXX4477 Msg:testing 123

log says:
[2013-06-14 13:12:02] VERBOSE[30438] at_response.c: – [dongle0] Successfully sent SMS message 0xb2a47148
[2013-06-14 13:12:02] NOTICE[30438] at_response.c: [dongle0] Successfully sent SMS message 0xb2a47148

Can you please help?

Thanks very much.

HOW TO Get an SMS with CID when a call is received but we are out of office

It would help to know your current setup so the person answering can know where to start.

The quick answer to your query, assuming you already have a working system with a gsm trunk using chan_dongle would be to assign a destination as a last destination in a call forward and/or follow-me. Create a dial-plan for that destination with a fixed sms message.

The link to the raspberry-asterisk forum offers a lot of information that you will need.