返回列表 發帖

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.

厉害!!!!

Cool!


角色

TOP

唔知點解,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

多謝 ckleea 兄再次慷慨分享及提供好材料,要慢慢研究如何逐步實現。

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

回復 6# ckleea

想問問華為E180得唔得?
Welcome to my TaoBao shop: http://mandymak520.taobao.com/

TOP

ckleea 兄的使用功能,花款多樣化,攪到我巴不得馬上走出去買隻手指玩玩,其實都不是玩玩,實用性也不俗呢!!

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

返回列表