Hi Christopher, 

There seems to be a problem with your recv sqlbox instance, could you please
copy the configuration files for all the recv instances so we can take a
look at it? 

Have you seen anything wrong in your log files?

Juan L.

From:  Christopher Burke <[email protected]>
Date:  Wednesday, June 13, 2012 2:39 PM
To:  Juan Luis Gomez Correa <[email protected]>
Cc:  <[email protected]>
Subject:  Re: [Queued] Receive Messages using Kannel

Hi Juan,

It doesn't appear to be receiving the messages, actually. I have written the
following PHP code to attempt to update a MySQL table however perhaps I have
misunderstood something somewhere.

<?php
$phone = $_GET["p"];
$text  = $_GET["msg"];

$con = mysql_connect("localhost", "foo", "******") or die(mysql_error());

mysql_select_db("kannel", $con) or die(mysql_error());

mysql_query("INSERT INTO kannel (PHONE, TEXT) VALUES ('$phone', '$text')")
or die(mysql_error());

mysql_close($con);
?>

When I visit the respective URL in my browser, and set the parameters it
works, however. Perhaps this is the reason? If I do not have my SMS-SERVICE
configured, I just receive a text back saying "Sorry, could not fetch
content"

Thanks for your help!

Kind Regards,

Christopher 

On 13 June 2012 18:27, Juan Luis Gomez Correa
<[email protected]> wrote:
> Hi Christopher, all traffic is stored in the sent_sms table, that's the reason
> why there is an momt field in that table, so you can know which kind of
> message it is, have you checked your sqlbox log file? Maybe there is some kind
> of helpful info on it.
> 
> Other thing that is not clear to me, is your sms-service URL receiving the
> MOs?
> 
> Thanks.
> 
> Juan L.
> 
> 
> From:  Christopher Burke <[email protected]>
> Date:  Wednesday, June 13, 2012 12:19 PM
> To:  Julien Buratto <[email protected]>
> Cc:  <[email protected]>
> Subject:  Re: [Queued] Receive Messages using Kannel
> 
> Hi Julien,
> 
> Strangely, I sometimes see received messages in my sent_sms table, do you know
> why this might occur?
> 
> Kind Regards,
> 
> Christopher
> 
> On 13 June 2012 18:15, Julien Buratto <[email protected]> wrote:
>> The "sent_sms" table stores the sms that have been sent. Not the SMS that get
>> received :-)
>> It may happen that you see them appearing there when you send them from your
>> sending instance of kannel ?
>> 
>> So basically when you send a message (ie INSERT a row in the send_sms table),
>> the sms get routed to your SMSC and then removed from the send_sms table and
>> copied into the sent_sms table.
>> 
>> When you receive messages, you should take care of saving them in your
>> script:
>> http://sub.url.tld/sms.php?p=%p&msg=message
>> 
>> 
>> 
>> 2012/6/13 Christopher Burke <[email protected]>
>>> Hi, 
>>> 
>>> I currently have two SMSCs running on two separate Kannel instances. I am
>>> using version -r4979 Kannel from the SVN on a Linux machine, and I have set
>>> up the Kannel instances as follows: three separate configuration files for
>>> the bearerbox, smsbox and sqlbox respectively shown below.
>>> 
>>> send_kannel.conf
>>> ############################################################
>>> # KANNEL CONFIGURATION    #
>>> ############################################################
>>> 
>>> group = core
>>> admin-port = 14000
>>> smsbox-port = 14001
>>> admin-password = ******
>>> log-file = "/var/log/kannel/send/log_core.log"
>>> access-log = "/var/log/kannel/send/acc_core.log"
>>> log-level = 0
>>> box-deny-ip = "*.*.*.*"
>>> box-allow-ip = "*.*.*.*"
>>> 
>>> ############################################################
>>> # SMSC Connections    #
>>> ############################################################
>>> 
>>> group = smsc
>>> smsc = smpp 
>>> smsc-id = ******
>>> host = ******
>>> port = ****
>>> transceiver-mode = true
>>> smsc-username = ******
>>> smsc-password = ******
>>> system-type = "SMPP"
>>> address-range = ******
>>> source-addr-ton = 1
>>> source-addr-npi = 1
>>> dest-addr-ton = 1
>>> dest-addr-npi = 1
>>> bind-addr-ton = 1
>>> bind-addr-npi = 1
>>> 
>>> group = smsbox
>>> 
>>> send_smsbox.conf
>>> ############################################################
>>> # KANNEL CONFIGURATION    #
>>> ############################################################
>>> 
>>> group = core
>>> smsbox-port = 14005
>>> 
>>> group                           = smsbox
>>> smsbox-id                       = send_smsbox
>>> bearerbox-host                  = localhost
>>> bearerbox-port = 14005
>>> sendsms-port                    = 14013
>>> global-sender                   = 447797882105 <tel:447797882105>
>>> sendsms-chars                   = "0123456789+" # -+
>>> log-file                        = "/var/log/kannel/send/log_smsbox.log"
>>> log-level                       = 0
>>> access-log                      = "/var/log/kannel/send/acc_smsbox.log"
>>> 
>>> ############################################################
>>> # SENDSMS USER CONFIGURATIONS    #
>>> ############################################################
>>> 
>>> group = sendsms-user
>>> username = "wim"
>>> password = "wim"
>>> 
>>> send_sqlbox.conf
>>> ############################################################
>>> # KANNEL CONFIGURATION    #
>>> ############################################################
>>> 
>>> group = sqlbox
>>> id = send_sqlbox
>>> smsbox-id = send_sqlbox
>>> #global-sender = ""
>>> bearerbox-host = localhost
>>> bearerbox-port = 14001
>>> smsbox-port = 14005
>>> smsbox-port-ssl = false
>>> sql-log-table = sent_sms
>>> sql-insert-table = send_sms
>>> log-file = "/var/log/kannel/send/log_sqlbox.log"
>>> log-level = 0
>>> #ssl-client-certkey-file = ""
>>> #ssl-server-cert-file = ""
>>> #ssl-server-key-file = ""
>>> #ssl-trusted-ca-file = ""
>>> 
>>> group = mysql-connection
>>> id = send_sqlbox
>>> host = localhost
>>> username = ******
>>> password = ******
>>> database = kannel
>>> 
>>> I then launch Kannel with the following Shell script:
>>> 
>>> #!/bin/bash
>>> # BEARERBOXES
>>> nohup /usr/local/sbin/bearerbox -v 1 /etc/kannel/recv/recv_kannel.conf &
>>> nohup /usr/local/sbin/bearerbox -v 1 /etc/kannel/send/send_kannel.conf &
>>> sleep 5
>>> # SQLBOXES 
>>> nohup /usr/local/sbin/sqlbox -v 1 /etc/kannel/recv/recv_sqlbox.conf &
>>> nohup /usr/local/sbin/sqlbox -v 1 /etc/kannel/send/send_sqlbox.conf &
>>> sleep 5
>>> # SMSBOXES 
>>> nohup /usr/local/sbin/smsbox -v 1 /etc/kannel/recv/recv_smsbox.conf &
>>> nohup /usr/local/sbin/smsbox -v 1 /etc/kannel/send/send_smsbox.conf &
>>> 
>>> So I have two SMSCs, one which sends messages and another which receives
>>> messages. Both of the SMSCs have their own Kannel (Bearerbox, SMSBox,
>>> SQLBox) and one of the SMSCs is set to send messages, the other is set to
>>> receive them. 
>>> 
>>> The receive box has the following recv_smsbox.conf (sms-service etc);
>>> 
>>> ############################################################
>>> # SENDSMS USER CONFIGURATIONS    #
>>> ############################################################
>>> 
>>> group = sendsms-user
>>> username = "wim"
>>> password = "wim"
>>> 
>>> ############################################################
>>> # SMS-SERVICE                                              #
>>> ############################################################
>>> 
>>> group                           = sms-service
>>> keyword-regex = .*
>>> catch-all = yes
>>> get-url                         =
>>> "http://sub.url.tld/sms.php?p=%p&msg=message";
>>> accept-x-kannel-headers = true
>>> concatenation = true
>>> max-messages = 0
>>> 
>>> With this, I see the incoming messages in my acc_core.log however they're
>>> not in my sent_sms table. What I'd like, is to have any and all messages
>>> sent to the recv Kannel to appear in the sent_sms table (I sometimes get
>>> them to appear if I send a message to the phone, and respond).
>>> 
>>> Any pointers or help is much appreciated!
>>> 
>>> Kind Regards,
>>> 
>>> Christopher
>>> 
>> 
>> 
>> 
>> -- 
>> Julien Buratto
>> Linkas SRL
>> Tel. 0230321419
> 



-- 
Christopher Burke
http://simulity.com
Mobile: +44 7590 571 833
Skype: krslynx



Reply via email to