Board logo

標題: Incoming SMS received by Asterisk [打印本頁]

作者: ckleea    時間: 2011-3-19 21:38     標題: 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.
作者: 角色    時間: 2011-3-19 21:53

厉害!!!!

Cool!


角色
作者: ckleea    時間: 2011-3-19 22:06

唔知點解,incoming and outgoing call do not work.
I check my modem has been unlocked and voice enable
作者: ckleea    時間: 2011-3-21 09:12

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/
作者: bubblestar    時間: 2011-3-21 09:28

多謝 ckleea 兄再次慷慨分享及提供好材料,要慢慢研究如何逐步實現。
作者: ckleea    時間: 2011-3-21 09:31

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?
作者: 雯雯    時間: 2011-3-21 10:53

回復 6# ckleea

想問問華為E180得唔得?
作者: bubblestar    時間: 2011-3-21 11:28

ckleea 兄的使用功能,花款多樣化,攪到我巴不得馬上走出去買隻手指玩玩,其實都不是玩玩,實用性也不俗呢!!
作者: ckleea    時間: 2011-3-21 11:48

物盡其用
作者: ckleea    時間: 2011-3-21 11:55

回復 7# 雯雯


    E180 ok, should work. Second hand is ok for me. No need for Internet up or download, just voice and SMS
作者: ckleea    時間: 2011-3-21 15:07

I got wrong time received from asterisk
作者: ckleea    時間: 2011-3-21 22:40

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()
複製代碼

作者: ckleea    時間: 2011-3-21 22:43

回復 8# bubblestar


    希望遲D等我做到voice in and out
作者: ckleea    時間: 2011-3-22 14:22

回復 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
作者: ckleea    時間: 2011-3-22 21:22

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
作者: bubblestar    時間: 2011-3-22 22:19

Does normal phone call work between other POTS or Mobile ?
作者: ckleea    時間: 2011-3-22 22:21

Other phone works but not 3G modem.
作者: ckleea    時間: 2011-3-23 10:49

回復 7# 雯雯


你是否有E180 手指,有兴趣试voice 部分。
作者: 雯雯    時間: 2011-3-23 13:57

回復 18# ckleea

有呀! 但是我放了在深圳這邊, 要不我找人把它帶回港再郵寄給你, 還是......
作者: ckleea    時間: 2011-3-23 14:16

有空的话,请寄给我。如果voice 成功,USB 手指将是一个非常好的FXO + SMS gateway。有asterisk server 的用家可以好快建立。一点都不困难。
作者: bubblestar    時間: 2011-3-23 14:37

好誇張!!!  上面嗰張用了48隻手指,而下面嗰張相連接四隻手指做gsm gateway,點都夠成個家庭用啦!


datacards.jpg


01cc27f298a56b9eae9173fefee779a9_media_500x439.jpg

圖片附件: 01cc27f298a56b9eae9173fefee779a9_media_500x439.jpg (2011-3-23 14:36, 20.3 KB) / 下載次數 809
http://www.telecom-cafe.com/forum/attachment.php?aid=567&k=24c32945cc604985f451f20bfb2abbcc&t=1714223590&sid=9ZjyjJ



圖片附件: datacards.jpg (2011-3-23 14:36, 74.23 KB) / 下載次數 714
http://www.telecom-cafe.com/forum/attachment.php?aid=568&k=26e4f7876ce04dbca4d550df20a56e3e&t=1714223590&sid=9ZjyjJ


作者: ckleea    時間: 2011-3-23 14:41

就是这样,我用一支,不过如果有spare,加多支都得。可惜,SMS 用土炮。
作者: bubblestar    時間: 2011-3-23 15:03

下面個USB HUB 都幾型仔,插晒四條USB 手指後,好似組成一支全方位天線的模樣。
作者: Qnewbie    時間: 2011-3-23 17:23

好誇張!!!  上面嗰張用了48隻手指,而下面嗰張相連接四隻手指做gsm gateway,點都夠成個家庭用啦!





...
bubblestar 發表於 2011-3-23 14:37

OMG...

Wondering when all sticks are working, how do they solve the signal interference...
作者: ckleea    時間: 2011-3-23 20:46

It is about the se as other SMS gateway but using stick is wasting
作者: ckleea    時間: 2011-3-23 20:46

It is about the se as other SMS gateway but using stick is wasting
作者: 雯雯    時間: 2011-3-23 22:13

回復 21# bubblestar

真厲害! 點樣可以做到1部機插48隻USB手指呢?
作者: bubblestar    時間: 2011-3-23 23:10

回復 27# 雯雯


   
一般16 ports 都會容易見到,32 ports、48 ports 就很少見了。

但係原來連 49 ports 都有啊!  http://www.crunchgear.com/2009/0 ... st-plain-practical/

而這個只是一個32 ports USB charging station http://www.cambrionix.com/cambri ... ChargingStation.htm
作者: ckleea    時間: 2011-3-29 14:53

回復 28# bubblestar


    Be got prepared for a USB 3G stick. Soon or later there will be a frontend program to send out SMS vai asterisk.
作者: bubblestar    時間: 2011-3-29 15:07

回復 29# ckleea


   

如果有front-end program send SMS,就真係超方便了,想抗拒唔買唔得了。非常期待!!

這邊廂忙著OBi110,那邊廂又攪那個SMS over USB 3G stick on Asterisk,真是忙透了,不過實用又好玩,又可以學新東西,值得值得。

Cool !!
作者: ckleea    時間: 2011-3-29 15:13

請等我消息和測試,不用心急買手指。
作者: bubblestar    時間: 2011-3-29 15:20

麻煩晒!! 請慢慢試。
作者: 雯雯    時間: 2011-3-29 19:23

回復 32# bubblestar

等ckleea兄消息吧! 他剛剛收到我借出的華為E180.
作者: ckleea    時間: 2011-3-29 20:18

Have tried a lot of test. Seem problem in Chinese SMS still exists.
作者: ckleea    時間: 2011-3-29 21:55

聲音係有,不過好多雜音。
作者: ckleea    時間: 2011-3-31 07:06

I check and find that I need a kernel > 2.6.18 But the latest stable Centos 5 kernel is 2.6.18. The developer said 2.6.18 has problem in ttyUSB handling

I try the mainline 2..6.38 but it fails to compile Dadhi and so asterisk is not working.
作者: ckleea    時間: 2011-3-31 08:06

已經成功,打出打入冇問題。要用kernel 2.6.38, compile again dadhi with the new kernel.
音色可以接受,等SMS frontend.
作者: ckleea    時間: 2011-3-31 08:08

回復 33# 雯雯


    你的手指應該冇問題,但已寄回。
作者: ckleea    時間: 2011-3-31 08:12

Have tried to put in three sticks at the same time. Recognize two, the third one has problem in recognition . Not due to software but firmware problem.
作者: ckleea    時間: 2011-3-31 08:58

回復 36# ckleea

I have more problems with 2.6.38 now.
作者: ckleea    時間: 2011-3-31 09:03

The IP of the server changes. Need to fix it later. Can access via internet
作者: candenn    時間: 2011-4-11 01:35

強!用到 USB 3G modem 的確方便!
作者: ckleea    時間: 2011-4-11 06:29

回復 42# candenn


    都係個句,物盡其用。
作者: ckleea    時間: 2011-4-22 11:42

回復 42# candenn

好可惜,asterisk 唔受中文




歡迎光臨 電訊茶室 (http://www.telecom-cafe.com/forum/) Powered by Discuz! 7.2