PlaySMS+Kannel Do not receive sms!


(Василий Блиндул) #1

Hello!

I want to implement such a scheme, is it possible?
smpp client–>opensmppbox–>kannel smsbox–>playsms user.

my kannel.conf

group = core
admin-port = 13000
admin-password = admpwdnotsafe
status-password = admpwdnotsafe
smsbox-port = 13001
log-level = 0
log-file = /etc/kannel/logs/kannel.log
access-log = /etc/kannel/logs/access.log
store-type = spool
store-location = /var/spool/kannel/store
smsbox-max-pending = 100

group = smsc
smsc = smpp
smsc-id = smpp
host = localhost
port = 13001
smsc-username = smpp
smsc-password = smpp
system-type = VMA
transceiver-mode = true
enquire-link-interval=30
reconnect-delay=10
interface-version=34
log-file = /etc/kannel/logs/smsc1.log
allowed-smsc-id = smpp

SMSBOX SETUP

group = smsbox
bearerbox-host = localhost
bearerbox-port = 13001
smsbox-id = SMSBOX
sendsms-port = 13131
log-file = /etc/kannel/logs/smsbox.log
log-level = 0
immediate-sendsms-reply = false

group = smsbox-route
smsbox-id = SMSBOX
smsc-id = smpp

SENDSMS-USER

group = sendsms-user
default-smsc = smpp
username = smpp
password = smpp
max-messages = 6
concatenation = true

group = sms-service
keyword = default
omit-empty = true
max-messages = 0
get-url = "http://localhost/playsms/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a&Q=%Q&smsc=smpp"
post-url = “http://localhost/playsms/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a&Q=%Q&smsc=smpp

Logs error.

2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: handling message (0x1aa2490 vs 0x1aa2490)
2017-07-05 18:59:51 [13954] [7] DEBUG: Routing failed, re-queued.
2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: handling message (0x1aa26f0 vs 0x1aa2490)
2017-07-05 18:59:51 [13954] [7] DEBUG: Routing failed, re-queued.
2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: handling message (0x1aa2080 vs 0x1aa2490)
2017-07-05 18:59:51 [13954] [7] DEBUG: Routing failed, re-queued.
2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: handling message (0x1aa1c70 vs 0x1aa2490)
2017-07-05 18:59:51 [13954] [7] DEBUG: Routing failed, re-queued.
2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: handling message (0x1aa2490 vs 0x1aa2490)
2017-07-05 18:59:51 [13954] [7] DEBUG: Routing failed, re-queued.
2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: time to sleep 30.00 secs.
2017-07-05 18:59:51 [13954] [0] INFO: Loaded 119 messages from store.
2017-07-05 18:59:51 [13954] [0] INFO: MAIN: Start-up done, entering mainloop
2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: gwlist_len = 119
2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: handling message (0x1aa26f0 vs 0x1aa26f0)
2017-07-05 18:59:51 [13954] [7] DEBUG: Routing failed, re-queued.
2017-07-05 18:59:51 [13954] [7] DEBUG: sms_router: handling message (0x1aa2080 vs 0x1aa26f0)
2017-07-05 18:59:51 [13954] [7] DEBUG: Routing failed, re-queued.
2017-07-05 18:59:51 [13954] [5] INFO: Client connected from <127.0.0.1>


(Edilson Spessoto) #2

playSMS geturl.php is just for receiving DLRs, aren´t? Once I coded a seturl.php for playSMS kannel plugin, that received messages from kannel, and injected them on playSMS. Worked right, the only thing I didn´t get was return DLR back to opensmppbox esme.

Here it is, please, let me know if you have sucess.

<?php /** * This file is part of playSMS. * * playSMS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * playSMS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with playSMS. If not, see . */ if (!$called_from_hook_call) { chdir("../../../"); // ignore CSRF $core_config['init']['ignore_csrf'] = TRUE; include "init.php"; include $core_config['apps_path']['libs'] . "/function.php"; chdir("plugin/gateway/kannel"); } if ($smsc = $requests['smsc']) { // override plugin gateway configuration by smsc configuration $plugin_config = gateway_apply_smsc_config($smsc, $plugin_config); } $remote_addr = $_SERVER['REMOTE_ADDR']; // srosa 20100531: added var below $remote_host = $_SERVER['HTTP_HOST']; // srosa 20100531: changed test below to allow hostname in bearerbox_host instead of ip // if ($remote_addr != $plugin_config['kannel']['bearerbox_host']) if ($remote_addr != $plugin_config['kannel']['bearerbox_host'] && $remote_host != $plugin_config['kannel']['bearerbox_host']) { _log("unable to process incoming SMS. remote_addr:[" . $remote_addr . "] or remote_host:[" . $remote_host . "] does not match with your bearerbox_host config:[" . $plugin_config['kannel']['bearerbox_host'] . "] smsc:[" . $smsc . "]", 2, "kannel incoming"); exit(); } // if the arrival time is in UTC then we need to adjust it with this: if ($plugin_config['kannel']['local_time']) { $t = trim($_REQUEST['t']); } else { // in UTC $t = core_display_datetime($_REQUEST['t']); } $q = trim($_REQUEST['q']); // sms_sender $a = trim(htmlspecialchars_decode(urldecode($_REQUEST['a']))); // message $Q = trim($_REQUEST['Q']); // sms_receiver $smsc = trim($_REQUEST['smsc']); // SMSC _log("remote_addr:" . $remote_addr . " remote_host:" . $remote_host . " t:[" . $t . "] q:[" . $q . "] a:[" . $a . "] Q:[" . $Q . "] smsc:[" . $smsc . "] smsc:[" . $smsc . "]", 3, "kannel incoming"); if ($t && $q && $a) { // collected: // $sms_datetime, $sms_sender, $message, $sms_receiver $q = addslashes($q); $a = addslashes($a); sendsms_helper($Q, $q, $a); ob_end_clean(); echo "ok"; flush(); exit(); } else { _log("missing parameter t:[" . $t . "] q:[" . $q . "] a:[" . $a . "] smsc:[" . $smsc . "]", 2, "kannel incoming"); }

(Edilson Spessoto) #3

group = smsc
smsc = http
system-type = generic
smsc-id = entrada
allowed-smsc-id = entrada
port = 13016
//# q = sender Q = receiver n = usuario %I the SMS ID of the internal message structure %F the foreign (smsc-provided) message ID. Only relevant on DLR url’s.
send-url = "http://xxx.xxx.xxx.xxx/sms_bkp/index.php?app=call&cat=gateway&plugin=kannel&access=seturl&t=%t&q=%q&a=%a&Q=%n&smsc=%i&intId=%I&forId=%F"
status-success-regex = "ok"
status-permfail-regex = "failure"
status-tempfail-regex = "retry later"
generic-foreign-id-regex = "(.+)"
log-file=/var/log/kannel/smsc-entrada.log
log-level=0
reroute-dlr=true
connect-allow-ip=...


(Василий Блиндул) #4

Good afternoon!
Thanks for your reply.
I get the following error

2017-07-07 14:37:25 [15111] [9] DEBUG: HTTP [entrada]: Sending request <http://127.0.0.1/playsms/index.php?app=call&cat=gateway&plugin=kannel&access=seturl&t= 2017-07-07 + 08: 37: 25 & q =% 2B62000000000 & a = testtttttttttttttttt & Q = smpp & smsc = entrada & intId = 29f444d2-ccc1-470e-b646-97d9e44c8843 & forId = 29f444d2-ccc1-470e-b646-97d9e44c8843>
2017-07-07 14:37:25 [15111] [8] ERROR: HTTP [entrada]: Message was rejected. SMSC reponse was:
2017-07-07 14:37:25 [15111] [8] DEBUG: Octet string at 0x7f5f2c0008c0:
2017-07-07 14:37:25 [15111] [8] DEBUG: len: 0
2017-07-07 14:37:25 [15111] [8] DEBUG: size: 0
2017-07-07 14:37:25 [15111] [8] DEBUG: immutable: 0
2017-07-07 14:37:25 [15111] [8] DEBUG: Octet string dump ends.
2017-07-07 14:37:25 [15111] [8] DEBUG: SMSC [entrada]: creating DLR message
2017-07-07 14:37:25 [15111] [8] DEBUG: SMSC [entrada]: DLR = 29f444d2-ccc1-470e-b646-97d9e44c8843