我是kannel配置的新手。我遵循用户指南1.5。
我希望将opensmppbox用作我的客户的网关,以便他们通过SMPP协议进行连接。
但我想使用http作为smsc (客户的smppclient ---> opensmppbox ---> sqlbox ---> smsbox ---> kannel ---> smsc = http --->运营商HTTP-gateway)
关于opensmppbox配置我几乎没有问题
1)如何从运营商HTTP网关获取交付报告并将交付报告发送回客户的smppclient? 2)为什么sms详细信息没有插入到send_sms表中? 3)为什么交付报告没有插入到dlr表中? 4)为什么我在sqlbox和smsbox上看不到任何事件? 5)尽管提到相同的
,dlr-url仍未被调用我的配置如下:
========================================
==> smskannel.conf
========================================
#
# THIS IS A SAMPLE CONFIGURATION FOR SMS KANNEL
#
# This basic version is used for system testing. It expects 'fakesmsc' to
# send messages which are replied with simple fixed text message.
# It is run like this:
#
# 1% gw/bearerbox gw/smskannel.conf
# 2% gw/smsbox gw/smskannel.conf
# 3% test/fakesmsc -i 0.1 -m 100 "123 345 text nop"
#
# ..all 3 commands in separate shells (or screen sessions)
# Note that you can run them in different machines but have to
# add certain command line argument and configuration variables then
#
#
# For any modifications to this file, see Kannel User Guide
# If that does not help, see Kannel web page (http://www.kannel.org) and
# various online help and mailing list archives
#
# Notes on those who base their configuration on this:
# 1) check security issues! (allowed IPs, passwords and ports)
# 2) groups cannot have empty rows inside them!
# 3) read the user guide
#
# Kalle Marjola for Kannel project 2001, 2004
#---------------------------------------------
# CORE
#
# There is only one core group and it sets all basic settings
# of the bearerbox (and system). You should take extra notes on
# configuration variables like 'store-file' (or 'store-dir'),
# 'admin-allow-ip' and 'access.log'
group = core
dlr-storage=mysql
admin-port = 13000
smsbox-port = 13001
admin-password = bar
#status-password = foo
#admin-deny-ip = ""
#admin-allow-ip = ""
log-file = "/var/log//kannel/kannel.log"
#log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
#unified-prefix = "+358,00358,0;+,00"
access-log = "/var/log/kannel/access.log"
#store-file = "kannel.store"
#ssl-server-cert-file = "cert.pem"
#ssl-server-key-file = "key.pem"
#ssl-certkey-file = "mycertandprivkeyfile.pem"
#---------------------------------------------
# SMSC CONNECTIONS
#
# SMSC connections are created in bearerbox and they handle SMSC specific
# protocol and message relying. You need these to actually receive and send
# messages to handset, but can use GSM modems as virtual SMSCs
# This is a fake smsc connection, _only_ used to test the system and services.
# It really cannot relay messages to actual handsets!
group = smsc
smsc = http
smsc-id = http
system-type = generic
port = 13015
connect-allow-ip = "*.*.*.*"
#dlr-mask=3
#dlr-url="http://192.168.1.132/dlr.php?report=%d"
#dlr-url=urlencode(http://192.168.1.132/dlr.php?report=%d)
send-url = "http://192.168.1.111/btisms/V1/smppsms?username=cust2&sms_type=SMPP&from=%P&message=%I-%t&recipient=%p&type=%d&dlr-mask=3&dlr-url=urlencode(http://192.168.1.132/dlr.php?report=%d)"
status-success-regex = "success"
status-permfail-regex = "failure"
status-tempfail-regex = "retry later"
generic-foreign-id-regex = "<id>(.+)</id>"
generic-param-from = "senderID"
generic-param-to = "to"
generic-param-text = "text"
generic-param-dlr-mask = "DLRStatus"
generic-param-dlr-mid = "msgID"
generic-param-dlr-url = "DLRUrl"
generic-param-flash = "flash"
generic-param-mclass = "mclass"
generic-param-mwi = "mwi"
generic-param-coding = "coding"
generic-param-validity = "validity"
generic-param-deferred = "deferred"
generic-param-foreign-id = "foreignID"
generic-message-sent = "Message sent with ID: %I"
generic-status-sent = 200
generic-status-error = 404
connect-allow-ip = 127.0.0.1
#---------------------------------------------
# SMSBOX SETUP
#
# Smsbox(es) do higher-level SMS handling after they have been received from
# SMS centers by bearerbox, or before they are given to bearerbox for delivery
group = smsbox
smsbox-id = mysmsbox
bearerbox-host = 127.0.0.1
#bearerbox-port = 13003
sendsms-port = 13013
#global-sender = 13013
access-log = "/var/log/kannel/smsbox-access.log"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
group = smsbox-route
smsbox-id = mysmsbox
smsc-id = http
group = mysql-connection
id = mydlr
host = localhost
username = root
password = XXXXXX
database = dlr
# you can increase this upon a higher load
max-connections = 1
group = dlr-db
id = mydlr
table = dlr
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
========================================
==> sqlbox.conf
========================================
group = sqlbox
id = sqlbox-db
smsbox-id = mysmsbox
bearerbox-host = 127.0.0.1
bearerbox-port = 13001
smsbox-port = 13005
smsbox-port-ssl = false
sql-log-table = sent_sms
sql-insert-table = send_sms
log-file = "/var/log/kannel/kannel-sqlbox.log"
log-level = 0
group = mysql-connection
id = sqlbox-db
host = localhost
username = root
password = ecosmob
database = dlr
max-connections = 1
========================================
==> opensmppbox.conf
========================================
group = core
dlr-storage = mysql
group = opensmppbox
opensmppbox-id = OPENSMPP
opensmppbox-port = 2775
bearerbox-host = 127.0.0.1
bearerbox-port = 13001
#our-system-id = VFSSMPP1
our-system-id = mysmsbox
smpp-logins = /usr/local/kannel/smpplogins.txt
use-systemid-as-smsboxid = true
#route-to-smsc = smsc
log-file = /usr/local/kannel/smppbox.log
group = mysql-connection
id = mydlr
host = localhost
username = root
password = XXXXX
database = dlr
# you can increase this upon a higher load
max-connections = 1
group = dlr-db
id = mydlr
table = dlr
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 = boxcid
The steps that I follow to send sms are as below:
1. start the bearbox
2. start the smsbox
3. start the sqlbox
4. start the smppbox
5. sent a message from smpp client(192.168.1.132) php script, which is as below:
#!/usr/bin/php
<?php
require_once 'smppclient.class.php';
require_once 'gsmencoder.class.php';
require_once 'sockettransport.class.php';
// Construct transport and client
$transport = new SocketTransport(array('192.168.1.81'),2775);
$transport->setRecvTimeout(10000);
$smpp = new SmppClient($transport);
// Activate binary hex-output of server interaction
$smpp->debug = true;
$transport->debug = true;
// Open the connection
$transport->open();
$smpp->bindTransmitter("cust2","cust@123");
// Optional connection specific overrides
//SmppClient::$sms_null_terminate_octetstrings = false;
//SmppClient::$csms_method = SmppClient::CSMS_PAYLOAD;
//SmppClient::$sms_registered_delivery_flag = SMPP::REG_DELIVERY_SMSC_BOTH;
// Prepare message
$message = 'Hello world';
$encodedMessage = GsmEncoder::utf8_to_gsm0338($message);
$from = new SmppAddress('98248222',SMPP::TON_ALPHANUMERIC);
$to = new SmppAddress('972526228604',SMPP::TON_INTERNATIONAL,SMPP::NPI_E164);
// Send
$smpp->sendSMS($from,$to,$encodedMessage,$tags);
$smpp->bindReceiver("cust2","cust@123");
// Read SMS and output
$sms = $smpp->readSMS();
echo "\n\n\nSMS:\n\n";
var_dump($sms);
// Close connection
$smpp->close();
?>
Any help is really appreciable
Please let me know if there's any information needed from my side
答案 0 :(得分:3)
将dlr-mask更改为19
send-url = "http://192.168.1.111/btisms/V1/smppsms?username=cust2&sms_type=SMPP&from=%P&message=%I-%t&recipient=%p&type=%d&dlr-mask=19&dlr-url=urlencode(http://192.168.1.132/dlr.php?report=%d)"
来自Kannel用户指南:“dlr-mask:可选。请求发送报告,其中包含已发送消息的状态。该值是由以下内容组成的位掩码:
1: Delivered to phone,
2: Non-Delivered to Phone,
4: Queued on SMSC,
8: Delivered to SMSC,
16: Non-Delivered to SMSC.