1

kannel 設定は初めてです。ユーザーガイド 1.5 に従います。

SMPP プロトコル経由で接続する方法で、opensmppbox を顧客のゲートウェイとして使用したいと考えています。

しかし、smsc として http を使用したい (顧客の smppclient ---> opensmppbox --->sqlbox--->smsbox---> kannel---> smsc=http---> operator HTTP-gateway)

opensmppbox の設定についていくつか質問があります

1) オペレーターの HTTP-gateway から配信レポートを取得し、配信レポートを顧客の 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
4

1 に答える 1

5

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.
于 2016-08-30T17:11:30.600 に答える