sqlbox kannel

Nico Brenner nico at lemontech.cl
Mon Oct 30 16:49:43 CET 2006


Hi Eryam, I have successfully built and installed sqlbox standalone  
in my machine, and I even set up 3 sqlboxes with 3 smsboxes, here is  
my /etc/init.d/kannel file which might serve you as an example on how  
to run sqlbox (I also include the sqlbox and smsbox configuration):

------------------------------------------------------------
!/bin/sh

# Configuration file
CONF=/etc/kannel/kannel.conf
SMS1_CONF=/etc/kannel/smsbox1.conf
SMS2_CONF=/etc/kannel/smsbox2.conf
SQL_CONF=/etc/kannel/sqlbox.conf
SQL1_CONF=/etc/kannel/sqlbox1.conf
SQL2_CONF=/etc/kannel/sqlbox2.conf

# Kannel boxes
BEARERBOX=/usr/local/sbin/bearerbox
SMSBOX=/usr/local/sbin/smsbox
WAPBOX=/usr/local/sbin/wapbox
SQLBOX=/usr/local/bin/sqlbox

# Debug level: 0..4
DEBUGLEVEL=4

# Kannel user account
USER=kannel

# Check that boxes and config are ok
[ -x $BEARERBOX ] || exit 0
[ -x $SMSBOX ] || exit 0
[ -x $SQLBOX ] || exit 0
[ -f $CONF ] || exit 0

case "$1" in
start)
       ulimit -n 8192
       echo -n "Starting bearerbox... "
       #$BEARERBOX -v $DEBUGLEVEL --daemonize --user $USER $CONF &
       $BEARERBOX -v $DEBUGLEVEL --user $USER $CONF &
       echo "done"
       echo -n
       sleep 3

       echo -n "Starting sqlbox... "
       #$SMSBOX -v $DEBUGLEVEL --daemonize --user $USER $CONF &
       $SQLBOX -v $DEBUGLEVEL --user $USER $SQL_CONF &
       $SQLBOX -v $DEBUGLEVEL --user $USER $SQL1_CONF &
       $SQLBOX -v $DEBUGLEVEL --user $USER $SQL2_CONF &
       echo "done"
       echo -n
       sleep 3

       echo -n "Starting smsbox... "
       #$SMSBOX -v $DEBUGLEVEL --daemonize --user $USER $CONF &
       $SMSBOX -v $DEBUGLEVEL --user $USER $CONF &
       $SMSBOX -v $DEBUGLEVEL --user $USER $SMS1_CONF &
       $SMSBOX -v $DEBUGLEVEL --user $USER $SMS2_CONF &
       echo "done"

       echo -n "Starting wapbox... "
       #$WAPBOX -v $DEBUGLEVEL --daemonize --user $USER $CONF &
       $WAPBOX -v $DEBUGLEVEL --user $USER $CONF &
       echo "done"
       ;;
stop)
       echo -n "Shutting down smsbox... "
       killall smsbox
       echo "done"
       echo -n "Shutting down wapbox... "
       killall wapbox
       echo "done"
       echo -n "Shutting down sqlbox... "
       killall sqlbox
       echo "done"
       sleep 3
       echo -n "Shutting down bearerbox... "
       killall bearerbox
       echo "done"
       ;;
restart)
       $0 stop
       sleep 3
       $0 start
       ;;
*)
       echo "Usage: kannel {start|stop|restart}"
       exit 1
esac

exit 0
------------------------------------------------------------

My sqlbox.conf file:
Here the configuration basically tells sqlbox that the actual  
bearerbox is on localhost port 13001, and that it should allow  
connections from smsbox on port 13003. Also it should log messages to  
the tables send_sms and sent_sms.
------------------------------------------------------------
group = sqlbox
id = sqlbox-db
smsbox-id = smsbox
bearerbox-host = localhost
bearerbox-port = 13001
smsbox-port = 13003
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 = xxxx
password = yyyy
database = database_name
max-connections = 10
------------------------------------------------------------

My smsbox configuration:
This tells the smsbox that the bearerbox is on localhost port 13003  
(so it will connect to the sqlbox listening port, instead of directly  
connecting to the bearerbox) and that it should listen for HTTP  
sendsms requests on port 13014.
------------------------------------------------------------
group = smsbox
reply-requestfailed = "No existe un servicio asociado"
bearerbox-host = localhost
bearerbox-port = 13003
sendsms-port = 13014
log-file = "/var/log/kannel/smsbox1.log"
access-log = "/var/log/kannel/access1.log"
log-level = 0
http-request-retry = 3
http-queue-delay = 15
sendsms-chars = "0123456789 +-"
------------------------------------------------------------

The directive to set the bearerbox listening port (sqlbox's  
'bearerbox-port') is

group = core
smsbox-port = 13001

usually found on /etc/kannel.conf (The above tells bearerbox to  
listen on port 13001 for incoming smsbox connections. Since with the  
above set up smsboxes connect to sqlbox, only sqlboxes will be  
connecting to bearerbox directly, and smsboxes will only connect to  
sqlbox).

Hope it helps.

Nicolás Brenner

On Oct 30, 2006, at 12:28 PM, Eyram Schwinger wrote:

> it is supposed to but when I compile both separately and try to run  
> bearerbox it panics when it encounters the beaerbox-is-sqlbox =  
> true in the smsbox group of the configuration and I cannot add the  
> sqlbox group to the configuration so I have to run it separately.  
> when I start bearerbox and later run sqlbox the bearerbox times out  
> trying to connect to sqlbox and sqlbox terminates. because to  
> install I first build kannel with
>
> ./configure --with-mysql --with-mysql-dir=/usr/bin
> make
> make install
>
> I later run nnthe same for sqlbox to install it. what am I not  
> doing right with the sqlbox standalone module
>
> ----- Original Message ----
> From: Mi Reflejo <reflejo at gmail.com>
> To: Eyram Schwinger <eschwinger at yahoo.com>
> Cc: kannel <users at kannel.org>
> Sent: Monday, 30 October, 2006 2:37:29 PM
> Subject: Re: sqlbox kannel
>
> Which statements? Sqlbox now is stand alone and it is compiled using
> kannel libraries. You don't need touch kannel files anymore.
>
> M
>
> On 10/30/06, Eyram Schwinger <eschwinger at yahoo.com> wrote:
> >
> > Hi,
> > Do you build kannel sepapately from sqlbox. If that is not the  
> case then the
> > question is would you havev to copy the contents of the sqlbox  
> standalone
> > version into the gateway folder and run the configure. I'm asking  
> this
> > because it seems as if there are certain statements that go into the
> > smsbox.c file that you dont get when you run them separately.  
> even after I
> > have patched i realised i still missed some statements
> >
> > Send instant messages to your online friends http:// 
> uk.messenger.yahoo.com
>
>
> The all-new Yahoo! Mail goes wherever you go - free your email  
> address from your Internet provider.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.kannel.org/pipermail/users/attachments/20061030/12834927/attachment-0001.html 


More information about the users mailing list