Kannel Cant与smsc建立联系

时间:2018-02-05 13:55:06

标签: sms-gateway kannel

首次使用Kannel用户。尝试在我们的办公室网络上设置kannel短信网关,但似乎无法与smsc建立连接。请注意,smsc主机可以通过我们的网络在给定端口上进行telnet。以下是bearerbox日志。

2018-02-06 00:03:02 [9708] [0] INFO: Debug_lvl = -1, log_file = <none>, log_lvl = 0
2018-02-06 00:03:02 [9708] [0] INFO: REDIS: Connected to server at 10.4.163.221:6666.
2018-02-06 00:03:02 [9708] [0] INFO: REDIS: Selected database 0
2018-02-06 00:03:02 [9708] [0] INFO: REDIS: server version 2.8.20.
2018-02-06 00:03:02 [9708] [0] INFO: DLR using storage type: redis
2018-02-06 00:03:02 [9708] [0] DEBUG: Kannel bearerbox version `svn-r5111M'.
Build `Nov 11 2014 15:51:10', compiler `4.4.7 20120313 (Red Hat 4.4.7-11)'.
System Linux, release 2.6.32-642.el6.x86_64, version #1 SMP Wed Apr 13 00:51:26 EDT 2016, machine x86_64.
Hostname kannel64-001.dev1.whispir.net, IP 10.4.163.216.
Libxml version 2.7.6.
Using OpenSSL 1.0.1e-fips 11 Feb 2013.
Using hiredis API 0.10.1
Using native malloc.

2018-02-06 00:03:02 [9708] [0] INFO: Added logfile `/app/kannel-telcow/log/bearerbox.log' with level `0'.
2018-02-06 00:03:02 [9708] [0] INFO: Started access logfile `/app/kannel-telcow/log/access/access.log'.
2018-02-06 00:03:02 [9708] [0] INFO: HTTP: Opening server at port 13176.
2018-02-06 00:03:02 [9708] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
2018-02-06 00:03:02 [9708] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps to pid 9708.
2018-02-06 00:03:02 [9708] [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread)
2018-02-06 00:03:02 [9708] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) maps to pid 9708.
2018-02-06 00:03:02 [9708] [2] DEBUG: HTTP: Including port 13176, fd 11 for polling in server thread
2018-02-06 00:03:02 [9708] [0] DEBUG: Started thread 3 (gw/bb_http.c:httpadmin_run)
2018-02-06 00:03:02 [9708] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) maps to pid 9708.
2018-02-06 00:03:02 [9708] [0] DEBUG: starting smsbox connection module
2018-02-06 00:03:02 [9708] [0] INFO: BOXC: 'smsbox-max-pending' not set, using default (100).
2018-02-06 00:03:02 [9708] [0] DEBUG: Started thread 4 (gw/bb_boxc.c:sms_to_smsboxes)
2018-02-06 00:03:02 [9708] [4] DEBUG: Thread 4 (gw/bb_boxc.c:sms_to_smsboxes) maps to pid 9708.
2018-02-06 00:03:02 [9708] [0] DEBUG: Started thread 5 (gw/bb_boxc.c:smsboxc_run)
2018-02-06 00:03:02 [9708] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) maps to pid 9708.
2018-02-06 00:03:02 [9708] [0] INFO: Set SMS resend frequency to 60 seconds.
2018-02-06 00:03:02 [9708] [0] INFO: SMS resend retry set to unlimited.
2018-02-06 00:03:02 [9708] [0] DEBUG: MO concatenated message handling enabled
2018-02-06 00:03:02 [9708] [0] INFO: Set throughput to 15.000 for smsc id <smsc-au-telcow>
2018-02-06 00:03:02 [9708] [0] INFO: DLR rerouting for smsc id <smsc-au-telcow> disabled.
2018-02-06 00:03:02 [9708] [0] DEBUG: Started thread 6 (gw/smsc/smsc_smpp.c:io_thread)
2018-02-06 00:03:02 [9708] [6] DEBUG: Thread 6 (gw/smsc/smsc_smpp.c:io_thread) maps to pid 9708.
2018-02-06 00:03:02 [9708] [0] INFO: Set throughput to 15.000 for smsc id <smsc-au-telcow>
2018-02-06 00:03:02 [9708] [6] DEBUG: Connecting to <120.240.136.6>
2018-02-06 00:03:02 [9708] [0] INFO: DLR rerouting for smsc id <smsc-au-telcow> disabled.
2018-02-06 00:03:02 [9708] [0] DEBUG: Started thread 7 (gw/smsc/smsc_smpp.c:io_thread)
2018-02-06 00:03:02 [9708] [7] DEBUG: Thread 7 (gw/smsc/smsc_smpp.c:io_thread) maps to pid 9708.
2018-02-06 00:03:02 [9708] [0] DEBUG: Started thread 8 (gw/bb_smscconn.c:sms_router)
2018-02-06 00:03:02 [9708] [0] INFO: ----------------------------------------
2018-02-06 00:03:02 [9708] [0] INFO: Kannel bearerbox II version svn-r5111M starting
2018-02-06 00:03:02 [9708] [8] DEBUG: Thread 8 (gw/bb_smscconn.c:sms_router) maps to pid 9708.
2018-02-06 00:03:02 [9708] [7] DEBUG: Connecting to <120.240.136.7>
2018-02-06 00:03:02 [9708] [0] INFO: MAIN: Start-up done, entering mainloop
2018-02-06 00:03:02 [9708] [2] DEBUG: HTTP: Creating HTTPClient for `10.4.163.219'.
2018-02-06 00:03:02 [9708] [2] DEBUG: HTTP: Created HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:02 [9708] [3] DEBUG: HTTP: Destroying HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:02 [9708] [3] DEBUG: HTTP: Destroying HTTPClient for `10.4.163.219'.
2018-02-06 00:03:02 [9708] [7] DEBUG: SMPP[smsc-au-telcow]: Sending PDU:
2018-02-06 00:03:02 [9708] [7] DEBUG: SMPP PDU 0x7f9990001710 dump:
2018-02-06 00:03:02 [9708] [7] DEBUG:   type_name: bind_transceiver
2018-02-06 00:03:02 [9708] [7] DEBUG:   command_id: 9 = 0x00000009
2018-02-06 00:03:02 [9708] [7] DEBUG:   command_status: 0 = 0x00000000
2018-02-06 00:03:02 [9708] [7] DEBUG:   sequence_number: 1 = 0x00000001
2018-02-06 00:03:02 [9708] [7] DEBUG:   system_id: "someid"
2018-02-06 00:03:02 [9708] [7] DEBUG:   password: "somepasswd"
2018-02-06 00:03:02 [9708] [7] DEBUG:   system_type: ""
2018-02-06 00:03:02 [9708] [7] DEBUG:   interface_version: 52 = 0x00000034
2018-02-06 00:03:02 [9708] [7] DEBUG:   addr_ton: 0 = 0x00000000
2018-02-06 00:03:02 [9708] [7] DEBUG:   addr_npi: 0 = 0x00000000
2018-02-06 00:03:02 [9708] [7] DEBUG:   address_range: ""
2018-02-06 00:03:02 [9708] [7] DEBUG: SMPP PDU dump ends.
2018-02-06 00:03:02 [9708] [6] DEBUG: SMPP[smsc-au-telcow]: Sending PDU:
2018-02-06 00:03:02 [9708] [6] DEBUG: SMPP PDU 0x7f9994001670 dump:
2018-02-06 00:03:02 [9708] [6] DEBUG:   type_name: bind_transceiver
2018-02-06 00:03:02 [9708] [6] DEBUG:   command_id: 9 = 0x00000009
2018-02-06 00:03:02 [9708] [6] DEBUG:   command_status: 0 = 0x00000000
2018-02-06 00:03:02 [9708] [6] DEBUG:   sequence_number: 1 = 0x00000001
2018-02-06 00:03:02 [9708] [6] DEBUG:   system_id: someid
2018-02-06 00:03:02 [9708] [6] DEBUG:   password: "somepasswd"
2018-02-06 00:03:02 [9708] [6] DEBUG:   system_type: ""
2018-02-06 00:03:02 [9708] [6] DEBUG:   interface_version: 52 = 0x00000034
2018-02-06 00:03:02 [9708] [6] DEBUG:   addr_ton: 0 = 0x00000000
2018-02-06 00:03:02 [9708] [6] DEBUG:   addr_npi: 0 = 0x00000000
2018-02-06 00:03:02 [9708] [6] DEBUG:   address_range: ""
2018-02-06 00:03:02 [9708] [6] DEBUG: SMPP PDU dump ends.
2018-02-06 00:03:02 [9708] [2] DEBUG: HTTP: Creating HTTPClient for `10.4.163.220'.
2018-02-06 00:03:02 [9708] [2] DEBUG: HTTP: Created HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:02 [9708] [3] DEBUG: HTTP: Destroying HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:02 [9708] [3] DEBUG: HTTP: Destroying HTTPClient for `10.4.163.220'.
2018-02-06 00:03:03 [9708] [2] DEBUG: HTTP: Creating HTTPClient for `10.4.163.219'.
2018-02-06 00:03:03 [9708] [2] DEBUG: HTTP: Created HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:03 [9708] [3] DEBUG: HTTP: Destroying HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:03 [9708] [3] DEBUG: HTTP: Destroying HTTPClient for `10.4.163.219'.
2018-02-06 00:03:03 [9708] [2] DEBUG: HTTP: Creating HTTPClient for `10.4.163.220'.
2018-02-06 00:03:03 [9708] [2] DEBUG: HTTP: Created HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:03 [9708] [3] DEBUG: HTTP: Destroying HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:03 [9708] [3] DEBUG: HTTP: Destroying HTTPClient for `10.4.163.220'.
2018-02-06 00:03:04 [9708] [2] DEBUG: HTTP: Creating HTTPClient for `10.4.163.219'.
2018-02-06 00:03:04 [9708] [2] DEBUG: HTTP: Created HTTPClient area 0x7f999c000ad0.
2018-02-06 00:03:04 [9708] [3] DEBUG: HTTP: Destroying HTTPClient area 0x7f999c000ad0.

以下是kannel.conf文件。

    # Group Config
group = smsc
smsc=smpp
transceiver-mode = true
smsc-id=smsc-au-telcow
port=18766
host=120.240.136.6
system-type=
address-range=""
smsc-username=someid
smsc-password=somepasswd
source-addr-ton=1     
source-addr-npi=1
dest-addr-ton=1
dest-addr-npi=1
bind-addr-ton=0
bind-addr-npi=0
msg-id-type=0x01
alt-charset="ASCII"
keepalive=100
idle-timeout=100
max-pending-submits=10
use-ssl=true
throughput=15
interface-version=

group = smsc
smsc=smpp
transceiver-mode = true
smsc-id=smsc-au-telcow
port=18766
host=120.240.136.7
system-type=
address-range=""
smsc-username=someuid
smsc-password=somepasswd
source-addr-ton=1     
source-addr-npi=1
dest-addr-ton=1
dest-addr-npi=1
bind-addr-ton=0
bind-addr-npi=0
msg-id-type=0x01
alt-charset="ASCII"
keepalive=100
idle-timeout=100
max-pending-submits=10
use-ssl=true
throughput=15 
interface-version=

# CORE
group = core
admin-port=13176
smsbox-port=10176
admin-password=k4nn3l
log-file="/app/kannel-telcow/log/bearerbox.log"
log-level=0
access-log-format="%l [SMSC:%i] [SVC:%n] [ACT:%A] [BINF:%B] [FID:%F] [META:%D] [from:%p] [to:%P] [flags:%m:%c:%M:%C:%d] [msg:%L:%b] [udh:%U:%u]"
box-deny-ip="*.*.*.*"
box-allow-ip="127.0.0.1"
#unified-prefix = "00358,0"
access-log="/app/kannel-telcow/log/access/access.log"

dlr-storage = redis

# SMSBOX Setup
group = smsbox
bearerbox-host=localhost
sendsms-port=11176
log-file="/app/kannel-telcow/log/error-smsbox.log"
log-level=0
access-log="/app/kannel-telcow/log/smsaccess.log"
reply-couldnotfetch=""
reply-emptymessage=""
mo-recode=true

group = sendsms-user
username = someuser
password = somepwd
default-sender = 6148993003
default-smsc = 
omit-empty = true
max-messages = 10
concatenation = true


group = sms-service
keyword = default
accept-x-kannel-headers = true
get-url = "http://10.4.163.74/gateway_kannel/KannelEntrance?udh=%u&Command=%k&Sender=%p&SMSbody=%r&receiver=%P&fromSMSC=%i"
omit-empty = true
max-messages = 10

group = redis-connection
id = redisdlr
host = 10.4.163.221
port = 6666
database = 0
max-connections = 1

group = dlr-db
id = redisdlr
table = dlr
#ttl = 1
field-smsc = smsc
field-timestamp = ts
field-destination = destination
field-source = source
field-service = service
field-url = url
field-mask = mask
field-status = status
field-boxc-id = boxc 

以下是kannel.sh状态输出:请注意“连接......”如果一切顺利,它应该是“在线”。

[DEV.]root@kannel64-001t:/app/kannel-telcow/etc $ kannel.sh status telcow

=== telcow (13176) ===
Kannel bearerbox version `1.4.4'.
Status: running, uptime 0d 0h 0m 4s
    smsbox:(none), IP 127.0.0.1 (0 queued), (on-line 0d 0h 0m 3s)  
    smsc-au-telcow[smsc-au-telcow]    SMPP:120.240.136.6:18766/18766:someid: (connecting, rcvd: sms 0 (0.00,0.00,0.00) / dlr 0 (0.00,0.00,0.00), sent: sms 0 (0.00,0.00,0.00) / dlr 0 (0.00,0.00,0.00), failed 0, queued 0 msgs)
    smsc-au-telcow[smsc-au-telcow]    SMPP:120.240.136.7:18766/18766:someid: (connecting, rcvd: sms 0 (0.00,0.00,0.00) / dlr 0 (0.00,0.00,0.00), sent: sms 0 (0.00,0.00,0.00) / dlr 0 (0.00,0.00,0.00), failed 0, queued 0 msgs)

注意:由于安全原因,smsc用户名/密码,此文件中的IP地址已更改。有人可以就此提出建议吗我在这里真的很茫然。

非常感谢提前。

/ B

1 个答案:

答案 0 :(得分:-1)

你好,这是你所有的kannel.conf文件吗?避免在conf中没有值的属性。

  

例如:system =

我没有看到SMSBOX-ROUTE CONFIGURATION。     您需要配置将流转发到SMSBOX。这个配置对我有用。     请以这种方式更新您的kannel.conf文件并尝试:

#-------------CORE CONFIGURATION  ------------------------
group = core
admin-port=13176
smsbox-port=10176
admin-password=k4nn3l
log-file="/app/kannel-telcow/log/bearerbox.log"
log-level=0
access-log-format="%l [SMSC:%i] [SVC:%n] [ACT:%A] [BINF:%B] [FID:%F] [META:%D] [from:%p] [to:%P] [flags:%m:%c:%M:%C:%d] [msg:%L:%b] [udh:%U:%u]"
admin-allow-ip = "*.*"
box-deny-ip="*.*.*.*"
box-allow-ip="127.0.0.1"
#unified-prefix = "00358,0"
access-log="/app/kannel-telcow/log/access/access.log"


#----------GROUP CONFIGURATION --------------------------
group = smsc
smsc=smpp
transceiver-mode = true
smsc-id=smsc-au-telcow
port=18766
host=120.240.136.6
address-range=""
smsc-username=someid
smsc-password=somepasswd
source-addr-ton=1     
source-addr-npi=1
dest-addr-ton=1
dest-addr-npi=1
bind-addr-ton=1
bind-addr-npi=1
msg-id-type=0x01after this be assure that the executing user have the permission at last to write and read in the log file
alt-charset="ASCII"
keepalive=100
idle-timeout=100
max-pending-submits=10
use-ssl=true
wait-ack=600
throughput=60


#---------SMSBOX CONFIGURATION  -----------------------
group = smsbox
smsbox-id =smsbox
bearerbox-host="127.0.0.1"
sendsms-port=11176
log-file="/app/kannel-telcow/log/error-smsbox.log"
log-level=0
access-log="/app/kannel-telcow/log/smsaccess.log"



#-------------- SMSBOX-ROUTE CONFIGURATION ----------------
group = smsbox-route
smsbox-id =smsbox
smsc-id =smsc-au-telcow


#-------SMS-SERVICE CONFIGURATION --------------------------
group = sms-service
keyword = default
catch-all = true
accept-x-kannel-headers = true
get-url = "http://10.4.163.74/gateway_kannel/KannelEntrance?udh=%u&Command=%k&Sender=%p&SMSbody=%r&receiver=%P&fromSMSC=%i"
omit-empty = true
max-messages = 10
assume-plain-text = true


#-------SENDSMS-USER CONFIGURATION  ----------------------
group = sendsms-user
username = someuser
password = somepwd
default-sender = 6148993003
forced-smsc = smpp
omit-empty = true
max-messages = 10
concatenation = true

#---end.

之后确保执行用户具有在日志文件中写入和读取的权限