0

我使用 ubuntu 10.10

目前我使用此代码通过clickatell发送短信

 Message = space_to_plus("message de test."),
    Url = io_lib:format("http://api.clickatell.com/http/sendmsg?user=...&password=...&api_id=...&to=216~s&text=~s", [Name, Message]),
    http:request(lists:flatten(Url), sms).

目前我们与运营商 Orange达成协议

我们将通过此运营商发送短信

短信将使用 smpp 3.4 和 API kannel 发送

我使用以下命令安装 kannel:

apt-get install libxml2

apt-get install kannel 

对于 kannel.conf 的配置,我设置了这个值:

    group = core
    admin-port = 13000
    smsbox-port = 13001
    admin-password = zaibadmin
    status-password = zaibstatus
    log-file = "/var/log/kannel/bearerbox.log"
    log-level = 0
    box-deny-ip = "*.*.*.*"
    box-allow-ip = "127.0.0.1"


group = smsc
smsc = smpp
smsc-id = testsmsc
host = localhost
port = 2775
receive-port = 2775 
smsc-username = 'smppclient'
smsc-password = password
system-type = 'VMA'
service-type = 'test'
interface-version = 34
address-range = ''
msg-id-type = 0





    group = modems
    id = teltonika
    name = "Teltonika E12"
    detect-string = "Undefined"
    enable-mms = true
    init-string = "AT+CNMI=2,2,0,1,1"
    speed = 115200

    group = smsbox
    bearerbox-host = localhost
    sendsms-port = 13013
    global-sender = 13013
    sendsms-chars = "0123456789 +-"
    log-file = "/var/log/kannel/smsbox.log"
    log-level = 0
    access-log = "/var/log/kannel/access.log"

    group = sendsms-user
    username = kannel
    password = kannel
    concatenation = true
    max-messages = 3

    group = sms-service
    keyword = default
    get-url = "http://localhost/kannel/receivesms.php?sender=%p&text=%b"
    accept-x-kannel-headers = true
    max-messages = 3
    concatenation = true
    catch-all = true

我认为我们应该从操作员橙色中获得相同的参数,例如:

smsc-username
    smsc-password
    host
    port

当我在浏览器中尝试:

http://10.20.20.26:13000/status?password=zaibstatus

我有 :

Kannel bearerbox version `1.4.3'. Build `Apr 6 2010 13:16:08', compiler `4.4.3'. System Linux, release 2.6.32-41-generic, version #90-Ubuntu SMP Tue May 22 11:31:25 UTC 2012, machine i686. Hostname ubuntu, IP 127.0.1.1. Libxml version 2.7.6. Using OpenSSL 0.9.8k 25 Mar 2009. Compiled with MySQL 5.1.41, using MySQL 5.1.63. Using native malloc.

Status: running, uptime 0d 0h 0m 38s

WDP: received 0 (0 queued), sent 0 (0 queued)

SMS: received 0 (0 queued), sent 0 (0 queued), store size -1

SMS: inbound (0.00,0.00,0.00) msg/sec, outbound (0.00,0.00,0.00) msg/sec

DLR: 0 queued, using internal storage

Box connections:
    smsbox:(none), IP 127.0.0.1 (0 queued), (on-line 0d 0h 0m 33s)

SMSC connections:
    testsmsc    SMPP:localhost:2775/2775:'smppclient':'VMA' (re-connecting, rcvd 0, sent 0, failed 0, queued 0 msgs)

当我尝试:

http://10.20.20.26:13013/cgi-bin/sendsms?username=kannel&password=kannel&to=97919860&text=ZAIB+KANNEL+WORk

我有 :

3: Queued for later delivery

可以sameone帮我更正kannel.conf的配置吗

因为我认为我在这个配置中犯了一个错误

4

3 回答 3

0

我在网上找到了另一个与 kannel.conf 文件相关的配置

group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
log-file = "/tmp/kannel.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"

group=smsc
smsc=smpp
smsc-id=internal
interface-version=34
host=internal.smpp.ddj.co.za
port=9102
system-id=donsmpp
smsc-password=strngpas
system-type=default
transceiver-mode=1

group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
log-level = 0

当然我必须更改下面的设置

IP address
 System-id (username)
 Password
 port

我想知道正确的配置

因为我从旧配置中删除了这部分:

group = modems
    id = teltonika
    name = "Teltonika E12"
    detect-string = "Undefined"
    enable-mms = true
    init-string = "AT+CNMI=2,2,0,1,1"
    speed = 115200

 group = sendsms-user
    username = kannel
    password = kannel
    concatenation = true
    max-messages = 3

    group = sms-service
    keyword = default
    get-url = "http://localhost/kannel/receivesms.php?sender=%p&text=%b"
    accept-x-kannel-headers = true
    max-messages = 3
    concatenation = true
    catch-all = true
于 2013-02-26T10:08:50.613 回答
0

在您的状态中显示 SMSC 连接:testsmsc 处于重新连接状态,这就是它显示状态 Queued for later delivery 的原因。您需要在线建立 smsc 连接。

于 2013-09-19T16:11:01.220 回答
0

激活Kannel SMSBox

sudo mkdir -p /var/log/kannel /var/run/kannel /var/spool/kannel/store
sudo chown -R kannel /var/log/kannel /var/run/kannel /var/spool/kannel/store
sudo usermod -a -G dialout kannel

sudo sed -i 's/#START_SMSBOX/START_SMSBOX/' /etc/default/kannel

完毕!

于 2020-07-25T08:00:34.193 回答