Was this page helpful?

軟體 SMS Gateway - Kannel

    簡介

    Kannel 是一個非常強大 SMS Gateway 軟體,OpenSource 授權,運行於 Linux 作業系統。

    還有,主要特點是可以透過 HTTP-GET 方式發送 SMS。此軟體必須搭配 GSM gateway 的硬體。

    安裝開始

    安裝必要套件
    (http://www.kannel.org/download/1.4.3/README-1.4.3)

    yum install sgml-common psgml docbook-style-dsssl stylesheets jade jadetex transfig
    

    安裝 kannel

    yum install kannel
    

    F.A.Q

    Q: 錯誤訊息:

    2011-05-19 11:49:43 [27666] [6] ERROR: AT2[/dev/ttyUSB0]: CMS ERROR: +CMS ERROR: 500
    2011-05-19 11:49:43 [27666] [6] ERROR: AT2[/dev/ttyUSB0]: CMS ERROR: Unknown error. -> maybe Sim storage is full? I'll have a look at it. (500)

    Ans:

    Q: 錯誤訊息:

    2011-05-18 15:57:11 [3215] [6] ERROR: AT2[/dev/ttyUSB0]: open failed! ERRNO=13, 2011-05-18 15:57:11 [3215] [6] ERROR: System error 13: Permission denied

    Ans: 編輯 /etc/udev/rules.d/50-udev.rules

    KERNEL=="tty[A-Z]*",            NAME="%k", GROUP="kannel", MODE="0660"
    

    將 USB modem 拔掉重插,檢查裝置檔案權限,必須是 kannel:

     ls -l /dev/ttyUSB*
    crw-rw---- 1 root kannel 188, 0 May 18 16:00 /dev/ttyUSB0
    crw-rw---- 1 root kannel 188, 1 May 18 16:00 /dev/ttyUSB1
    crw-rw---- 1 root kannel 188, 2 May 18 16:00 /dev/ttyUSB2
    

     

    Q: 如何確定 smsbox 有啟動正常?

    Ans:
    1. 檢查 /var/log/kannel/bearerbox.log

    2011-05-19 11:26:06 [27666] [0] INFO: Adding interface *
    2011-05-19 11:26:06 [27666] [0] ERROR: Missing wapbox-port variable, cannot start WAP
    2011-05-19 11:26:06 [27666] [0] INFO: ----------------------------------------
    2011-05-19 11:26:06 [27666] [0] INFO: Kannel bearerbox II version 1.4.2 starting
    2011-05-19 11:26:06 [27666] [0] INFO: MAIN: Start-up done, entering mainloop
    2011-05-19 11:26:06 [27666] [6] INFO: AT2[/dev/ttyUSB0]: trying to use speed <460800> from modem definition
    2011-05-19 11:26:06 [27666] [6] INFO: AT2[/dev/ttyUSB0]: opening device
    2011-05-19 11:26:06 [27666] [5] INFO: Client connected from <127.0.0.1>
    2011-05-19 11:26:06 [27666] [6] INFO: AT2[/dev/ttyUSB0]: speed set to 460800
    2011-05-19 11:26:08 [27666] [6] INFO: AT2[/dev/ttyUSB0]: Closing device
    2011-05-19 11:26:08 [27666] [6] INFO: AT2[/dev/ttyUSB0]: speed is 460800
    2011-05-19 11:26:08 [27666] [6] INFO: AT2[/dev/ttyUSB0]: opening device
    2011-05-19 11:26:08 [27666] [6] INFO: AT2[/dev/ttyUSB0]: Logging in
    2011-05-19 11:26:08 [27666] [6] INFO: AT2[/dev/ttyUSB0]: init device
    2011-05-19 11:26:08 [27666] [6] INFO: AT2[/dev/ttyUSB0]: speed set to 460800
    2011-05-19 11:26:09 [27666] [6] INFO: AT2[/dev/ttyUSB0]: AT SMSC successfully opened.
    

    2. 關閉 kannel 服務,不會出現 FAILED。

    3. 送出 SMS 後,要傳回

    $ lynx --dump "http://localhost:13013/cgi-bin/sendsms?username=kannel&password=1234&to=09531234567&text=Hello"
    
       0: Accepted for delivery
    

    3. 修改 kannel.cponf,有關下述的

    group = smsc
    ....
    group = modems
    .... 
    

     

    Was this page helpful?
    標籤 (Edit tags)
    • No tags
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core