我一直使用smslib连接到我的短信服务提供商 我的SMS提供商有一个SMSC,我连接到发射器模式(不是收发器)。
我试图通过Kannel与此配置进行连接:
group = core
admin-port = 13000
smsbox-port = 13001
wapbox-port = 13002
admin-password = dad
admin-deny-ip = ""
admin-allow-ip = "*.*.*.*"
wapbox-port = 13002
wdp-interface-name = "*"
log-file = "/var/log/kannel/kannel.log"
log-level = 0
box-deny-ip = ""
box-allow-ip = "*.*.*.*"
# NOT USED
group = wapbox
bearerbox-host = localhost
log-file = "/var/log/wapbox.log"
log-level = 0
syslog-level = none
group = smsbox
bearerbox-host = localhost
sendsms-port = 13013
global-sender = 56951000000
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
smsbox-id = smsbox
group = smsc
smsc = smpp
smsc-id = dadn_1
host = hidden on purpose for this post
port = 54002
smsc-username = dadn_1
smsc-password = pwd_1
system-type = smpp_1
transceiver-mode = 0
interface-version = 34
allowed-smsc-id = dadn_1
my-number = hidden on purpose for this post
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 0
dest-addr-npi = 1
bind-addr-ton = 0
bind-addr-npi = 1
source-addr-autodetect = 1
group = sendsms-user
username = dad
password = dad
concatenation = true
max-messages = 10
group = sms-service
keyword = wwwservice
get-url = "http://......./send_dummy_mail.asp"
concatenation = true
catch-all = yes
当我拨打发送短信网址时,即:
http://.....:13013/cgi-bin/sendsms?username=dad&password=dad&to=....&text=test&smsc=dadn_1
我明白了:
0: Accepted for delivery
当我进入状态页面时,即:
http://.....:13000status.html?password=dad
我明白了:
Status: running, uptime 0d 0h 0m 45s
WDP: received 0 (0 queued), sent 0 (0 queued)
SMS: received 0 (0 queued), sent 1 (0 queued), store size -1
SMS: inbound (0.00,0.00,0.00) msg/sec, outbound (0.02,0.02,0.02) msg/sec
DLR: 0 queued, using internal storage
Box connections:
smsbox:smsbox, IP 127.0.0.1 (0 queued), (on-line 0d 0h 0m 41s)
SMSC connections:
dadn_1 SMPP:.......:54002/54002:dadn_1:smpp_1 (online 45s, rcvd 0, sent 1, failed 0, queued 0 msgs)
正如你所看到的,它说"发送1"。
在日志中,输入网址后,我就明白了:
2014-06-12 13:31:36 [28766] [6] DEBUG: SMPP[dadn_1]: Sending PDU:
2014-06-12 13:31:36 [28766] [6] DEBUG: SMPP PDU 0x7fb55c0016a0 dump:
2014-06-12 13:31:36 [28766] [6] DEBUG: type_name: submit_sm
2014-06-12 13:31:36 [28766] [6] DEBUG: command_id: 4 = 0x00000004
2014-06-12 13:31:36 [28766] [6] DEBUG: command_status: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: sequence_number: 9 = 0x00000009
2014-06-12 13:31:36 [28766] [6] DEBUG: service_type: NULL
2014-06-12 13:31:36 [28766] [6] DEBUG: source_addr_ton: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: source_addr_npi: 1 = 0x00000001
2014-06-12 13:31:36 [28766] [6] DEBUG: source_addr: "56951000000"
2014-06-12 13:31:36 [28766] [6] DEBUG: dest_addr_ton: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: dest_addr_npi: 1 = 0x00000001
2014-06-12 13:31:36 [28766] [6] DEBUG: destination_addr: "..." -- CENSORED ON PURPOSE
2014-06-12 13:31:36 [28766] [6] DEBUG: esm_class: 3 = 0x00000003
2014-06-12 13:31:36 [28766] [6] DEBUG: protocol_id: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: priority_flag: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: schedule_delivery_time: NULL
2014-06-12 13:31:36 [28766] [6] DEBUG: validity_period: NULL
2014-06-12 13:31:36 [28766] [6] DEBUG: registered_delivery: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: replace_if_present_flag: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: data_coding: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: sm_default_msg_id: 0 = 0x00000000
2014-06-12 13:31:36 [28766] [6] DEBUG: sm_length: 6 = 0x00000006
2014-06-12 13:31:36 [28766] [6] DEBUG: short_message: "testtt"
2014-06-12 13:31:36 [28766] [6] DEBUG: SMPP PDU dump ends.
2014-06-12 13:31:37 [28766] [6] DEBUG: SMPP[dadn_1]: Got PDU:
2014-06-12 13:31:37 [28766] [6] DEBUG: SMPP PDU 0x7fb55c0016a0 dump:
2014-06-12 13:31:37 [28766] [6] DEBUG: type_name: submit_sm_resp
2014-06-12 13:31:37 [28766] [6] DEBUG: command_id: 2147483652 = 0x80000004
2014-06-12 13:31:37 [28766] [6] DEBUG: command_status: 0 = 0x00000000
2014-06-12 13:31:37 [28766] [6] DEBUG: sequence_number: 9 = 0x00000009
2014-06-12 13:31:37 [28766] [6] DEBUG: message_id: "122892043"
2014-06-12 13:31:37 [28766] [6] DEBUG: SMPP PDU dump ends.
正如您所看到的," message_id"被分配等
但是,短信没有到达我的移动设备
如果我使用具有完全相同配置的SMSLIB,则SMS确实到达..因此我的提供商工作正常。
问题是:
0: Accepted for delivery
,我的提供商是否有错?短信是"那里"已经?答案 0 :(得分:0)
有两点需要注意。
您肯定需要发送和接收方式来发送和接收短信。
如果您在sms-service中使用“get-url”,那么该URL调用的输出应该是发送到STDOUT的文本。名称上写着“... / send_dummy_mail.asp”。我相信除了发送邮件之外,这个URL在STDOUT中返回一些内容。如果URL没有抛出任何STDOUT,那么您将不会收到任何作为响应发送的SMS。