使用 kannel 和 smmpsim 发送短信
Send sms using kannel & smmpsim
我正在尝试使用 kannel 和 smppsim 发送短信。
我使用 docker 作为容器。
我用这个 kannel.conf:
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
admin-allow-ip = "127.0.0.1;192.168.59.103"
box-allow-ip = "127.0.0.1;192.168.59.103"
group = smsc
smsc = smpp
smsc-id = SMPPSim
host = 192.168.59.103
port = 2775
transceiver-mode = 1
smsc-username = smppclient1
smsc-password = password
system-type = 'VMA'
#service-type = 'test'
interface-version = 34
#system-id = smppclient
preferred-smsc-id = SMPPSim
connect-allow-ip = 192.168.59.103
group = smsbox
bearerbox-host = bearerbox
sendsms-port = 13013
global-sender = 13013
group = sendsms-user
username = tester
password = foobar
group = sms-service
keyword = default
text = "No service specified"
发送短信请求时,我收到“0:已接受投递”
我在 smsbox 日志中看到这些错误:
2015-03-21 20:20:52 [1] [3] DEBUG: Status: 202 Answer: <Sent.>
2015-03-21 20:20:52 [1] [3] DEBUG: Delayed reply - wait for bearerbox
2015-03-21 20:20:52 [1] [0] DEBUG: Got ACK (0) of 74f9cefe-db95-4b7d-aa99-f07395d32915
2015-03-21 20:20:52 [1] [0] DEBUG: HTTP: Resetting HTTPClient for `192.168.59.3'.
2015-03-21 20:20:52 [1] [1] ERROR: Error reading from fd 24:
2015-03-21 20:20:52 [1] [1] ERROR: System error 104: Connection reset by peer
2015-03-21 20:20:52 [1] [1] DEBUG: HTTP: Destroying HTTPClient area 0x7fe8d0000ad0.
Bearbox 没有出现任何错误并且似乎将消息传递给了 smppsim,smppsim 在日志中显示了这一点:
21 Assessing state of 1 messages in the OutboundQueue
21 Message:2 state=DELIVERED
短信没有发送,是什么问题?
这可能是由于超时导致的远程问题丢失的问题。
而SMPPSim只是kannel的一个测试工具。它不会真正向您或提到的手机号码发送消息。要发送真实消息,您需要添加 gsm 调制解调器或 SMS 运营商详细信息。
您可以参考 kannel.org 中的用户指南。
要检查您的 kannel 状态,只需转到您的 kannel 的 http://localhost:13000/status?password=password(password)
我认为您的 Kannel 配置文件有问题,特别是 smsbox 和后续部分。我将以下内容用作 smsbox
group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
global-sender = your sim number which you use in USB modem
sendsms-chars = "0123456789 +-"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
access-log = "/var/log/kannel/access.log"
您可以从 here 获取我的完整配置文件。这对我来说很好。
我正在尝试使用 kannel 和 smppsim 发送短信。 我使用 docker 作为容器。 我用这个 kannel.conf:
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
admin-allow-ip = "127.0.0.1;192.168.59.103"
box-allow-ip = "127.0.0.1;192.168.59.103"
group = smsc
smsc = smpp
smsc-id = SMPPSim
host = 192.168.59.103
port = 2775
transceiver-mode = 1
smsc-username = smppclient1
smsc-password = password
system-type = 'VMA'
#service-type = 'test'
interface-version = 34
#system-id = smppclient
preferred-smsc-id = SMPPSim
connect-allow-ip = 192.168.59.103
group = smsbox
bearerbox-host = bearerbox
sendsms-port = 13013
global-sender = 13013
group = sendsms-user
username = tester
password = foobar
group = sms-service
keyword = default
text = "No service specified"
发送短信请求时,我收到“0:已接受投递”
我在 smsbox 日志中看到这些错误:
2015-03-21 20:20:52 [1] [3] DEBUG: Status: 202 Answer: <Sent.>
2015-03-21 20:20:52 [1] [3] DEBUG: Delayed reply - wait for bearerbox
2015-03-21 20:20:52 [1] [0] DEBUG: Got ACK (0) of 74f9cefe-db95-4b7d-aa99-f07395d32915
2015-03-21 20:20:52 [1] [0] DEBUG: HTTP: Resetting HTTPClient for `192.168.59.3'.
2015-03-21 20:20:52 [1] [1] ERROR: Error reading from fd 24:
2015-03-21 20:20:52 [1] [1] ERROR: System error 104: Connection reset by peer
2015-03-21 20:20:52 [1] [1] DEBUG: HTTP: Destroying HTTPClient area 0x7fe8d0000ad0.
Bearbox 没有出现任何错误并且似乎将消息传递给了 smppsim,smppsim 在日志中显示了这一点:
21 Assessing state of 1 messages in the OutboundQueue
21 Message:2 state=DELIVERED
短信没有发送,是什么问题?
这可能是由于超时导致的远程问题丢失的问题。 而SMPPSim只是kannel的一个测试工具。它不会真正向您或提到的手机号码发送消息。要发送真实消息,您需要添加 gsm 调制解调器或 SMS 运营商详细信息。 您可以参考 kannel.org 中的用户指南。 要检查您的 kannel 状态,只需转到您的 kannel 的 http://localhost:13000/status?password=password(password)
我认为您的 Kannel 配置文件有问题,特别是 smsbox 和后续部分。我将以下内容用作 smsbox
group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
global-sender = your sim number which you use in USB modem
sendsms-chars = "0123456789 +-"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
access-log = "/var/log/kannel/access.log"
您可以从 here 获取我的完整配置文件。这对我来说很好。