我正在使用 kannel 短信网关,发送短信
抱歉,如果之前有人问过这个问题,但我试图找到解决方案,但我没有得到任何解决方案,不幸的是我必须发布这个问题。
我正在通过 php 脚本(smpp 客户端)向 smpp 服务器发送消息,该服务器连接到承载盒并发送消息。
面临多个问题: 1. 无法获得交付报告 2. 在 smsbox 日志中出现错误:错误:URL <03b3423a> 不以http://' nor
https://'开头
我尝试了不同的解决方案,但没有一个有效。我需要如果号码“A”向号码“B”发送消息,那么号码“A”应该得到确认消息已发送到号码“B”
这是我的配置文件的详细信息:
kannel.conf
group = core
dlr-storage=internal
admin-port = 13000
smsbox-port = 13001
admin-password = bar
log-file = "/var/log//kannel/kannel.log"
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
access-log = "/var/log/kannel/access.log"
#---------------------------------------------
# SMSC CONNECTIONS
group = "smsc"
smsc = "http"
smsc-id = "http"
#system-type = "generic"
system-type = "kannel"
port = 13015
log-file = /var/log/kannel/smsc.log
status-success-regex = "success"
status-permfail-regex = "failure"
status-tempfail-regex = "retry later"
generic-status-sent = 200
generic-status-error = 404
#reroute-dlr = true
#transceiver-mode = 0
receive-port=13015
send-url = "http://192.168.1.124:8090"
smsc-username = "cust2"
smsc-password = "cust@123"
connect-allow-ip = "*.*.*.*"
#dlr-url="http://192.168.1.106/dlr.php?type=%d"
#---------------------------------------------
# SMSBOX SETUP
group = smsbox
bearerbox-host = 127.0.0.1
bearerbox-port = 13001
smsbox-id = cust2
#---------------------------------------------
# SEND-SMS USERS
group = sendsms-user
username = cust2
password = cust@123
#user-deny-ip = ""
#user-allow-ip = ""
#---------------------------------------------
# SERVICES
group = sms-service
keyword = default
text = "No service specified"
group = smsbox-route
smsbox-id = cust2
smsc-id = "http"
打开mppbox.conf
group = core
dlr-storage = internal
group = opensmppbox
opensmppbox-id = OPENSMPP
opensmppbox-port = 2775
bearerbox-host = 127.0.0.1
bearerbox-port = 13001
our-system-id = outbind
smpp-logins = /usr/local/kannel/smpplogins.txt
use-systemid-as-smsboxid = true
route-to-smsc = http
log-file = /usr/local/kannel/smppbox.log
发射器.php
<?php
//print "<pre>";
require_once "smpp.php";
$tx=new SMPP('192.168.1.81',2775);
$tx->debug=true;
$tx->system_type="http";
$tx->addr_npi=1;
$tx->sms_registered_delivery_flag=1;
$tx->sms_sm_default_msg_id=1;
//$tx->dlr_url="http://192.168.1.124/cgi-bim/drl";
//$tx->dlr_url="http://192.168.1.124:8090";
print_r($tx);
//print "open status: ".$tx->state."\n";
$tx->bindTransmitter("cust2","cust@123");
$tx->sms_source_addr_npi=1;
//$tx->sms_source_addr_ton=1;
$tx->sms_dest_addr_ton=1;
$tx->sms_dest_addr_npi=1;
$tx->sendSMS("2121","791400000","Hello world");
//$tx->sendSMS("2121","2121","Hello world!!!");
$tx->close();
unset($tx);
如果需要任何进一步的信息,请告诉我提前感谢您的帮助