返回列表 發帖

Incoming SMS received by Asterisk

After some trials, I have successfully made my USB 3G modem receive incoming SMS by my asterisk server. The SMS is then routed to my gmail account.

Below is my email message received
2011-03-19 21:26:09 - datacard0 - +852xxxxxx: 你好嗎?

For outgoing SMS, still not yet able to send Chinese.

唔知點解,incoming and outgoing call do not work.
I check my modem has been unlocked and voice enable

TOP

My dialplan context is as follow

[datacard-incoming-sms]
exten => sms,1,Noop(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,Set(GLOBAL(isms)=/var/log/asterisk/sms/incoming/sms-${STRFTIME(${EPOCH},GMT+8,%C%y%m%d%H%M)})
exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DATACARD} - ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})}' > ${isms})
exten => sms,n,System(smtp-cli --from xxxx@yoursenderdomand --to xxxx@recipientdomain --subject "You got a new SMS " --attach ${isms} --host=smtp-server --user=yourusername --pass=yourpassword)
exten => sms,n,Hangup()

An unique message is kept at /var/log/asterisk/sms/incoming/, it will then be sent to your defined email address.

What you need is to
1. install a USB 3G modem and add chan_datacard driver to your asterisk (1.8 works)
details can be found here
http://wiki.e1550.mobi/doku.php
a cheap calling card should work. I use people
2. install smtp-cli from http://www.logix.cz/michal/devel/smtp-cli/

TOP

My USB 3G modem is E169G unlocked and voice is not supported.

We need to find unlocked E1550 or E169 for testing.

Anyone has E1550 (from PCCW) unlocked for trial?

TOP

物盡其用

TOP

回復 7# 雯雯


    E180 ok, should work. Second hand is ok for me. No need for Internet up or download, just voice and SMS

TOP

I got wrong time received from asterisk

TOP

This is the correct one. I fix it
  1. [datacard-incoming-sms]
  2. exten => sms,1,Noop(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
  3. exten => sms,n,Set(GLOBAL(isms)=/var/log/asterisk/sms/incoming/sms-${STRFTIME(${EPOCH},Hongkong,%G%m%d-%H%M%S)}.txt)
  4. exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DATACARD} - ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})}' > ${isms})
  5. exten => sms,n,System(smtp-cli --from sender@senddomain --to recipient@recipientdomain --subject "You got a new SMS " --attach ${isms} --host=smptserver --user=username --pass=password)
  6. exten => sms,n,Hangup()
複製代碼

TOP

回復 8# bubblestar


    希望遲D等我做到voice in and out

TOP

回復 12# ckleea
For timezone problem, please look at your directory /usr/share/zoneinfo to check for the presence of your timezone file. I was told that I put in GMT+8 but not found in my directory. But I did have the file called Hongkong, so after changing the format, I was able to get the correct date and time

TOP

I got a E3715 unlocked. Now can dial in and out but
on dialing out, can hear but no voice
dialing in, can't hear

TOP

Other phone works but not 3G modem.

TOP

回復 7# 雯雯


你是否有E180 手指,有兴趣试voice 部分。

TOP

有空的话,请寄给我。如果voice 成功,USB 手指将是一个非常好的FXO + SMS gateway。有asterisk server 的用家可以好快建立。一点都不困难。

TOP

就是这样,我用一支,不过如果有spare,加多支都得。可惜,SMS 用土炮。

TOP

返回列表