Я новичок в настройке kannel. Я следую инструкциям пользователя 1.5.
Я хочу использовать opensmppbox в качестве шлюза для моих клиентов таким образом, чтобы они подключались по протоколу SMPP.
Но я хочу использовать http как smsc
(smppclient клиентов —> opensmppbox —> sqlbox —> smsbox —> kannel —> smsc = http —> оператор HTTP-шлюза)
У меня есть несколько вопросов о конфигурации opensmppbox
1) Как я могу получить отчет о доставке от оператора HTTP-шлюза и отправить отчет о доставке обратно клиенту smppclient?
2) Почему подробности смс не вставляются в таблицу 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 = 1group = 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 = boxcidThe 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
Измените маску dlr на 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.
Других решений пока нет …