sqlbox does not connect to remote MySQL

2007-11-14 Thread Juan Nin
Hi!

I'm trying sqlbox, and I can't get it to connect to a remote MySQL server...
It's really strange...

I got dlr-storage = mysql with the same settings and it connects
fine, but sqlbox does not...
if I run a local MySQ, using localhost it works fine, but not with a
remote one...

Here's the error I get:

2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
`/var/log/kannel/sqlbox.log' with level `0'.
2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to database!
2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to MySQL
server on '10.10.10.2' (111)
2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database pool
has no connections!
2007-11-14 08:58:06 [18604] [0] PANIC:
/usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
2007-11-14 08:58:06 [18604] [0] PANIC:
/usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
2007-11-14 08:58:06 [18604] [0] PANIC:
/usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
2007-11-14 08:58:06 [18604] [0] PANIC:
/usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
2007-11-14 08:58:06 [18604] [0] PANIC:
/lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
2007-11-14 08:58:06 [18604] [0] PANIC: /usr/local/kannel/sbin/sqlbox [0x4099a9]

Here's the conf:

group= sqlbox
id   = sqlbox-db
smsbox-id= smsbox
bearerbox-host   = localhost
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/sqlbox.log
log-level= 0

group = mysql-connection
id = sqlbox-db
host = 10.10.10.2
username = myUser
password = myPass
database = kannel
max-connections = 1

And this is the conf for DLR which works fine:

group = mysql-connection
id = mydlr
host = 10.10.10.2
username = myUser
password = myPass
database = kannel
max-connections = 1

I even ran a tcpdump on the DB server, and I don't see packets
arriving for the sqlbox connection...
any ideas???

Thanks in advance,

Juan

PS: obviously connecting from the kannel host to the remote one via
console works (same info as for DLRs which connects ok)



Re: sqlbox does not connect to remote MySQL

2007-11-14 Thread seik
Err,
i think its the same issue as the one with the bearerbox host :/



-Original Message-
From: Juan Nin [EMAIL PROTECTED]
Sent: 14 ??? 2007 ?.
To: seik
Subject:sqlbox does not connect to remote MySQL 

 Hi!

 I'm trying sqlbox, and I can't get it to connect to a remote MySQL server...
 It's really strange...

 I got dlr-storage = mysql with the same settings and it connects
 fine, but sqlbox does not...
 if I run a local MySQ, using localhost it works fine, but not with a
 remote one...

 Here's the error I get:

 2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
 `/var/log/kannel/sqlbox.log' with level `0'.
 2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to database!
 2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to MySQL
 server on '10.10.10.2' (111)
 2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database pool
 has no connections!
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
 2007-11-14 08:58:06 [18604] [0] PANIC: /usr/local/kannel/sbin/sqlbox 
 [0x4099a9]

 Here's the conf:

 group= sqlbox
 id   = sqlbox-db
 smsbox-id= smsbox
 bearerbox-host   = localhost
 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/sqlbox.log
 log-level= 0

 group = mysql-connection
 id = sqlbox-db
 host = 10.10.10.2
 username = myUser
 password = myPass
 database = kannel
 max-connections = 1

 And this is the conf for DLR which works fine:

 group = mysql-connection
 id = mydlr
 host = 10.10.10.2
 username = myUser
 password = myPass
 database = kannel
 max-connections = 1

 I even ran a tcpdump on the DB server, and I don't see packets
 arriving for the sqlbox connection...
 any ideas???

 Thanks in advance,

 Juan

 PS: obviously connecting from the kannel host to the remote one via
 console works (same info as for DLRs which connects ok)





Re: sqlbox does not connect to remote MySQL

2007-11-14 Thread Juan Nin
mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and modified
the panic line in the end so the code is like here below, and the DB
params are shown ok


/*
 * ok, ready to connect to MySQL
 */
db_conf = gw_malloc(sizeof(DBConf));
gw_assert(db_conf != NULL);

db_conf-mysql = gw_malloc(sizeof(MySQLConf));
gw_assert(db_conf-mysql != NULL);

db_conf-mysql-host = mysql_host;
db_conf-mysql-username = mysql_user;
db_conf-mysql-password = mysql_pass;
db_conf-mysql-database = mysql_db;
if (have_port) {
db_conf-mysql-port = mysql_port;
}

pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
gw_assert(pool != NULL);

/*
 * XXX should a failing connect throw panic?!
 */
if (dbpool_conn_count(pool) == 0)
panic(0,SQLBOX: MySQL: database pool has no connections! host
'%s' user '%s' pass '%s' db '%s', octstr_get_cstr(mysql_host),
octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
octstr_get_cstr(mysql_db));
//panic(0,SQLBOX: MySQL: database pool has no connections!);



On Nov 14, 2007 12:41 PM, seik [EMAIL PROTECTED] wrote:
 Err,
 i think its the same issue as the one with the bearerbox host :/



 -Original Message-
 From: Juan Nin [EMAIL PROTECTED]
 Sent: 14 ??? 2007 ?.
 To: seik
 Subject:sqlbox does not connect to remote MySQL


  Hi!

  I'm trying sqlbox, and I can't get it to connect to a remote MySQL server...
  It's really strange...

  I got dlr-storage = mysql with the same settings and it connects
  fine, but sqlbox does not...
  if I run a local MySQ, using localhost it works fine, but not with a
  remote one...

  Here's the error I get:

  2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
  `/var/log/kannel/sqlbox.log' with level `0'.
  2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to database!
  2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to MySQL
  server on '10.10.10.2' (111)
  2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database pool
  has no connections!
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
  2007-11-14 08:58:06 [18604] [0] PANIC: /usr/local/kannel/sbin/sqlbox 
  [0x4099a9]

  Here's the conf:

  group= sqlbox
  id   = sqlbox-db
  smsbox-id= smsbox
  bearerbox-host   = localhost
  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/sqlbox.log
  log-level= 0

  group = mysql-connection
  id = sqlbox-db
  host = 10.10.10.2
  username = myUser
  password = myPass
  database = kannel
  max-connections = 1

  And this is the conf for DLR which works fine:

  group = mysql-connection
  id = mydlr
  host = 10.10.10.2
  username = myUser
  password = myPass
  database = kannel
  max-connections = 1

  I even ran a tcpdump on the DB server, and I don't see packets
  arriving for the sqlbox connection...
  any ideas???

  Thanks in advance,

  Juan

  PS: obviously connecting from the kannel host to the remote one via
  console works (same info as for DLRs which connects ok)






Re: sqlbox does not connect to remote MySQL

2007-11-14 Thread seik
Hi Juan,
sqlbox needs to be patched,
because the original source ignores the bearerbox host config value

I believe Alejandro Guerrieri [EMAIL PROTECTED] impelented the patch contact 
him.

Cheers

-Original Message-
From: Juan Nin [EMAIL PROTECTED]
Sent: 14 ??? 2007 ?.
To: seik
Subject:sqlbox does not connect to remote MySQL 

 Hi!

 I'm trying sqlbox, and I can't get it to connect to a remote MySQL server...
 It's really strange...

 I got dlr-storage = mysql with the same settings and it connects
 fine, but sqlbox does not...
 if I run a local MySQ, using localhost it works fine, but not with a
 remote one...

 Here's the error I get:

 2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
 `/var/log/kannel/sqlbox.log' with level `0'.
 2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to database!
 2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to MySQL
 server on '10.10.10.2' (111)
 2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database pool
 has no connections!
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
 2007-11-14 08:58:06 [18604] [0] PANIC: /usr/local/kannel/sbin/sqlbox 
 [0x4099a9]

 Here's the conf:

 group= sqlbox
 id   = sqlbox-db
 smsbox-id= smsbox
 bearerbox-host   = localhost
 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/sqlbox.log
 log-level= 0

 group = mysql-connection
 id = sqlbox-db
 host = 10.10.10.2
 username = myUser
 password = myPass
 database = kannel
 max-connections = 1

 And this is the conf for DLR which works fine:

 group = mysql-connection
 id = mydlr
 host = 10.10.10.2
 username = myUser
 password = myPass
 database = kannel
 max-connections = 1

 I even ran a tcpdump on the DB server, and I don't see packets
 arriving for the sqlbox connection...
 any ideas???

 Thanks in advance,

 Juan

 PS: obviously connecting from the kannel host to the remote one via
 console works (same info as for DLRs which connects ok)





Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread seik
I am about to do the same for sqlbox_pgsql.c :)

no time  so far :/



-Original Message-
From: Juan Nin [EMAIL PROTECTED]
Sent: 14 ??? 2007 ?.
To: seik
Subject:sqlbox does not connect to remote MySQL 

 mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and modified
 the panic line in the end so the code is like here below, and the DB
 params are shown ok


 /*
  * ok, ready to connect to MySQL
  */
 db_conf = gw_malloc(sizeof(DBConf));
 gw_assert(db_conf != NULL);

 db_conf-mysql = gw_malloc(sizeof(MySQLConf));
 gw_assert(db_conf-mysql != NULL);

 db_conf-mysql-host = mysql_host;
 db_conf-mysql-username = mysql_user;
 db_conf-mysql-password = mysql_pass;
 db_conf-mysql-database = mysql_db;
 if (have_port) {
 db_conf-mysql-port = mysql_port;
 }

 pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
 gw_assert(pool != NULL);

 /*
  * XXX should a failing connect throw panic?!
  */
 if (dbpool_conn_count(pool) == 0)
 panic(0,SQLBOX: MySQL: database pool has no connections! host
 '%s' user '%s' pass '%s' db '%s', octstr_get_cstr(mysql_host),
 octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
 octstr_get_cstr(mysql_db));
 //panic(0,SQLBOX: MySQL: database pool has no connections!);



 On Nov 14, 2007 12:41 PM, seik [EMAIL PROTECTED] wrote:
 Err,
 i think its the same issue as the one with the bearerbox host :/



 -Original Message-
 From: Juan Nin [EMAIL PROTECTED]
 Sent: 14 ??? 2007 ?.
 To: seik
 Subject:sqlbox does not connect to remote MySQL


  Hi!

  I'm trying sqlbox, and I can't get it to connect to a remote MySQL 
  server...
  It's really strange...

  I got dlr-storage = mysql with the same settings and it connects
  fine, but sqlbox does not...
  if I run a local MySQ, using localhost it works fine, but not with a
  remote one...

  Here's the error I get:

  2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
  `/var/log/kannel/sqlbox.log' with level `0'.
  2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to database!
  2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to MySQL
  server on '10.10.10.2' (111)
  2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database pool
  has no connections!
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
  2007-11-14 08:58:06 [18604] [0] PANIC: /usr/local/kannel/sbin/sqlbox 
  [0x4099a9]

  Here's the conf:

  group= sqlbox
  id   = sqlbox-db
  smsbox-id= smsbox
  bearerbox-host   = localhost
  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/sqlbox.log
  log-level= 0

  group = mysql-connection
  id = sqlbox-db
  host = 10.10.10.2
  username = myUser
  password = myPass
  database = kannel
  max-connections = 1

  And this is the conf for DLR which works fine:

  group = mysql-connection
  id = mydlr
  host = 10.10.10.2
  username = myUser
  password = myPass
  database = kannel
  max-connections = 1

  I even ran a tcpdump on the DB server, and I don't see packets
  arriving for the sqlbox connection...
  any ideas???

  Thanks in advance,

  Juan

  PS: obviously connecting from the kannel host to the remote one via
  console works (same info as for DLRs which connects ok)








Re: DLRs with sqlbox

2007-11-14 Thread seik
works for me, but i use unique dlr-url set in sendsms request




-Original Message-
From: Juan Nin [EMAIL PROTECTED]
Sent: 14 ??? 2007 ?.
To: seik
Subject:DLRs with sqlbox 

 do DLRs work while using sqlbox?

 I see them getting inserted in sent_sms table, but the dlr_url is not
 being called

 thanks in advance,

 Juan





DLRs with sqlbox

2007-11-14 Thread Juan Nin
do DLRs work while using sqlbox?

I see them getting inserted in sent_sms table, but the dlr_url is not
being called

thanks in advance,

Juan



Re: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Alejandro Guerrieri
Here is my patch for sqlbox to take host into account:

Index: gw/sqlbox.c
===
RCS file: /home/cvs/sqlbox/gw/sqlbox.c,v
retrieving revision 1.2
diff -u -r1.2 sqlbox.c
--- gw/sqlbox.c 30 May 2006 17:52:46 -  1.2
+++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
@@ -600,7 +600,6 @@

   /* some default values */
   sqlbox_port_ssl = 0;
-   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
   bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
   bearerbox_port_ssl = 0;
   logfile = NULL;
@@ -624,6 +623,10 @@
   if (grp == NULL)
   panic(0, No 'sqlbox' group in configuration);

+   bearerbox_host = cfg_get( grp, octstr_imm(bearerbox-host));
+   if (bearerbox_host == NULL)
+   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
+
   sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
   global_sender = cfg_get(grp, octstr_imm(global-sender));

===

Hope it helps,

Alejandro

On Nov 14, 2007 1:06 PM, seik [EMAIL PROTECTED] wrote:

 I am about to do the same for sqlbox_pgsql.c :)

 no time  so far :/



 -Original Message-
 From: Juan Nin [EMAIL PROTECTED]
 Sent: 14 ??? 2007 ?.
 To: seik
 Subject:sqlbox does not connect to remote MySQL

  mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and modified
  the panic line in the end so the code is like here below, and the DB
  params are shown ok


  /*
   * ok, ready to connect to MySQL
   */
  db_conf = gw_malloc(sizeof(DBConf));
  gw_assert(db_conf != NULL);

  db_conf-mysql = gw_malloc(sizeof(MySQLConf));
  gw_assert(db_conf-mysql != NULL);

  db_conf-mysql-host = mysql_host;
  db_conf-mysql-username = mysql_user;
  db_conf-mysql-password = mysql_pass;
  db_conf-mysql-database = mysql_db;
  if (have_port) {
  db_conf-mysql-port = mysql_port;
  }

  pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
  gw_assert(pool != NULL);

  /*
   * XXX should a failing connect throw panic?!
   */
  if (dbpool_conn_count(pool) == 0)
  panic(0,SQLBOX: MySQL: database pool has no connections! host
  '%s' user '%s' pass '%s' db '%s', octstr_get_cstr(mysql_host),
  octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
  octstr_get_cstr(mysql_db));
  //panic(0,SQLBOX: MySQL: database pool has no connections!);



  On Nov 14, 2007 12:41 PM, seik [EMAIL PROTECTED] wrote:
  Err,
  i think its the same issue as the one with the bearerbox host :/
 
 
 
  -Original Message-
  From: Juan Nin [EMAIL PROTECTED]
  Sent: 14 ??? 2007 ?.
  To: seik
  Subject:sqlbox does not connect to remote MySQL
 
 
   Hi!
 
   I'm trying sqlbox, and I can't get it to connect to a remote MySQL
 server...
   It's really strange...
 
   I got dlr-storage = mysql with the same settings and it connects
   fine, but sqlbox does not...
   if I run a local MySQ, using localhost it works fine, but not with a
   remote one...
 
   Here's the error I get:
 
   2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
   `/var/log/kannel/sqlbox.log' with level `0'.
   2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to
 database!
   2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to MySQL
   server on '10.10.10.2' (111)
   2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database pool
   has no connections!
   2007-11-14 08:58:06 [18604] [0] PANIC:
   /usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
   2007-11-14 08:58:06 [18604] [0] PANIC:
   /usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
   2007-11-14 08:58:06 [18604] [0] PANIC:
   /usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
   2007-11-14 08:58:06 [18604] [0] PANIC:
   /usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
   2007-11-14 08:58:06 [18604] [0] PANIC:
   /lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
   2007-11-14 08:58:06 [18604] [0] PANIC: /usr/local/kannel/sbin/sqlbox
 [0x4099a9]
 
   Here's the conf:
 
   group= sqlbox
   id   = sqlbox-db
   smsbox-id= smsbox
   bearerbox-host   = localhost
   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/sqlbox.log
   log-level= 0
 
   group = mysql-connection
   id = sqlbox-db
   host = 10.10.10.2
   username = myUser
   password = myPass
   database = kannel
   max-connections = 1
 
   And this is the conf for DLR which works fine:
 
   group = mysql-connection
   id = mydlr
   host = 10.10.10.2
   username = myUser
   password = myPass
   database = kannel
   max-connections = 1
 
   I even ran a tcpdump on the DB server, and I don't see packets
   arriving for the sqlbox connection...
   any ideas???
 
   Thanks in advance,
 
   Juan
 
   PS: obviously connecting from 

Re: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Juan Nin
Alejandro,

is this needed for sqlbox to be able to connect to a remote mysql?

thanks!

Juan

On Nov 14, 2007 1:41 PM, Alejandro Guerrieri
[EMAIL PROTECTED] wrote:
 Here is my patch for sqlbox to take host into account:

 Index: gw/sqlbox.c
 ==
 =
 RCS file: /home/cvs/ sqlbox/gw/sqlbox.c,v
 retrieving revision 1.2
 diff -u -r1.2 sqlbox.c
 --- gw/sqlbox.c 30 May 2006 17:52:46 -   1.2
 +++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
 @@ -600,7 +600,6 @@

 /* some default values */
 sqlbox_port_ssl = 0;
 -   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
 bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
 bearerbox_port_ssl = 0;
 logfile = NULL;
 @@ -624,6 +623,10 @@
 if (grp == NULL)
 panic(0, No ' sqlbox' group in configuration);

 +   bearerbox_host = cfg_get( grp, octstr_imm(bearerbox-host));
 +   if (bearerbox_host == NULL)
 +   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
 +
 sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
 global_sender = cfg_get(grp, octstr_imm(global-sender));

 ===

 Hope it helps,

 Alejandro



 On Nov 14, 2007 1:06 PM, seik [EMAIL PROTECTED] wrote:
  I am about to do the same for sqlbox_pgsql.c :)
 
  no time  so far :/
 
 
 
 
 
 
  -Original Message-
  From: Juan Nin [EMAIL PROTECTED] ]
  Sent: 14 ??? 2007 ?.
  To: seik
  Subject:sqlbox does not connect to remote MySQL
 
   mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and modified
   the panic line in the end so the code is like here below, and the DB
   params are shown ok
 
 
   /*
* ok, ready to connect to MySQL
*/
   db_conf = gw_malloc(sizeof(DBConf));
   gw_assert(db_conf != NULL);
 
   db_conf-mysql = gw_malloc(sizeof(MySQLConf));
   gw_assert(db_conf-mysql != NULL);
 
   db_conf-mysql-host = mysql_host;
   db_conf-mysql-username = mysql_user;
   db_conf-mysql-password = mysql_pass;
   db_conf-mysql-database = mysql_db;
   if (have_port) {
   db_conf-mysql-port = mysql_port;
   }
 
   pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
   gw_assert(pool != NULL);
 
   /*
* XXX should a failing connect throw panic?!
*/
   if (dbpool_conn_count(pool) == 0)
   panic(0,SQLBOX: MySQL: database pool has no connections! host
   '%s' user '%s' pass '%s' db '%s', octstr_get_cstr(mysql_host),
   octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
   octstr_get_cstr(mysql_db));
   //panic(0,SQLBOX: MySQL: database pool has no connections!);
 
 
 
   On Nov 14, 2007 12:41 PM, seik [EMAIL PROTECTED] wrote:
   Err,
   i think its the same issue as the one with the bearerbox host :/
  
  
  
   -Original Message-
   From: Juan Nin [EMAIL PROTECTED]
   Sent: 14 ??? 2007 ?.
   To: seik
   Subject:sqlbox does not connect to remote MySQL
  
  
Hi!
  
I'm trying sqlbox, and I can't get it to connect to a remote MySQL
 server...
It's really strange...
  
I got dlr-storage = mysql with the same settings and it connects
fine, but sqlbox does not...
if I run a local MySQ, using localhost it works fine, but not with a
remote one...
  
Here's the error I get:
  
2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
`/var/log/kannel/sqlbox.log' with level `0'.
2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to
 database!
2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to MySQL
server on '10.10.10.2' (111)
2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database pool
has no connections!
2007-11-14 08:58:06 [18604] [0] PANIC:
/usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
2007-11-14 08:58:06 [18604] [0] PANIC:
/usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
2007-11-14 08:58:06 [18604] [0] PANIC:
/usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
2007-11-14 08:58:06 [18604] [0] PANIC:
/usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
2007-11-14 08:58:06 [18604] [0] PANIC:
/lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
2007-11-14 08:58:06 [18604] [0] PANIC: /usr/local/kannel/sbin/sqlbox
 [0x4099a9]
  
Here's the conf:
  
group= sqlbox
id   = sqlbox-db
smsbox-id= smsbox
bearerbox-host   = localhost
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/sqlbox.log
log-level= 0
  
group = mysql-connection
id = sqlbox-db
host = 10.10.10.2
username = myUser
password = myPass
database = kannel
max-connections = 1
  
And this is the conf for DLR which works fine:
  
group = 

Re: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Alejandro Guerrieri
No, this is to be able to connect to a remote bearerbox.

Maybe there's a similar issue with mysql host? I'll check it out.

Regards,

Alejandro

On Nov 14, 2007 1:53 PM, Juan Nin [EMAIL PROTECTED] wrote:

 Alejandro,

 is this needed for sqlbox to be able to connect to a remote mysql?

 thanks!

 Juan

 On Nov 14, 2007 1:41 PM, Alejandro Guerrieri
 [EMAIL PROTECTED] wrote:
  Here is my patch for sqlbox to take host into account:
 
  Index: gw/sqlbox.c
  ==
  =
  RCS file: /home/cvs/ sqlbox/gw/sqlbox.c,v
  retrieving revision 1.2
  diff -u -r1.2 sqlbox.c
  --- gw/sqlbox.c 30 May 2006 17:52:46 -   1.2
  +++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
  @@ -600,7 +600,6 @@
 
  /* some default values */
  sqlbox_port_ssl = 0;
  -   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
  bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
  bearerbox_port_ssl = 0;
  logfile = NULL;
  @@ -624,6 +623,10 @@
  if (grp == NULL)
  panic(0, No ' sqlbox' group in configuration);
 
  +   bearerbox_host = cfg_get( grp, octstr_imm(bearerbox-host));
  +   if (bearerbox_host == NULL)
  +   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
  +
  sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
  global_sender = cfg_get(grp, octstr_imm(global-sender));
 
  ===
 
  Hope it helps,
 
  Alejandro
 
 
 
  On Nov 14, 2007 1:06 PM, seik [EMAIL PROTECTED] wrote:
   I am about to do the same for sqlbox_pgsql.c :)
  
   no time  so far :/
  
  
  
  
  
  
   -Original Message-
   From: Juan Nin [EMAIL PROTECTED] ]
   Sent: 14 ??? 2007 ?.
   To: seik
   Subject:sqlbox does not connect to remote MySQL
  
mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and
 modified
the panic line in the end so the code is like here below, and the DB
params are shown ok
  
  
/*
 * ok, ready to connect to MySQL
 */
db_conf = gw_malloc(sizeof(DBConf));
gw_assert(db_conf != NULL);
  
db_conf-mysql = gw_malloc(sizeof(MySQLConf));
gw_assert(db_conf-mysql != NULL);
  
db_conf-mysql-host = mysql_host;
db_conf-mysql-username = mysql_user;
db_conf-mysql-password = mysql_pass;
db_conf-mysql-database = mysql_db;
if (have_port) {
db_conf-mysql-port = mysql_port;
}
  
pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
gw_assert(pool != NULL);
  
/*
 * XXX should a failing connect throw panic?!
 */
if (dbpool_conn_count(pool) == 0)
panic(0,SQLBOX: MySQL: database pool has no connections!
 host
'%s' user '%s' pass '%s' db '%s', octstr_get_cstr(mysql_host),
octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
octstr_get_cstr(mysql_db));
//panic(0,SQLBOX: MySQL: database pool has no
 connections!);
  
  
  
On Nov 14, 2007 12:41 PM, seik [EMAIL PROTECTED] wrote:
Err,
i think its the same issue as the one with the bearerbox host :/
   
   
   
-Original Message-
From: Juan Nin [EMAIL PROTECTED]
Sent: 14 ??? 2007 ?.
To: seik
Subject:sqlbox does not connect to remote MySQL
   
   
 Hi!
   
 I'm trying sqlbox, and I can't get it to connect to a remote
 MySQL
  server...
 It's really strange...
   
 I got dlr-storage = mysql with the same settings and it
 connects
 fine, but sqlbox does not...
 if I run a local MySQ, using localhost it works fine, but not
 with a
 remote one...
   
 Here's the error I get:
   
 2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
 `/var/log/kannel/sqlbox.log' with level `0'.
 2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to
  database!
 2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to
 MySQL
 server on '10.10.10.2' (111)
 2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database
 pool
 has no connections!
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
 2007-11-14 08:58:06 [18604] [0] PANIC:
 /usr/local/kannel/sbin/sqlbox
  [0x4099a9]
   
 Here's the conf:
   
 group= sqlbox
 id   = sqlbox-db
 smsbox-id= smsbox
 bearerbox-host   = localhost
 bearerbox-port   = 13001
 smsbox-port  = 13005
 smsbox-port-ssl  = false

Re: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Juan Nin
don't think so

on my previous post i pasted some changes i made where it logs the
panic error, and the host, username, passwd and db are fine

not sure where the problem is  :(


On Nov 14, 2007 2:30 PM, Alejandro Guerrieri
[EMAIL PROTECTED] wrote:
 No, this is to be able to connect to a remote bearerbox.

 Maybe there's a similar issue with mysql host? I'll check it out.

 Regards,

 Alejandro



 On Nov 14, 2007 1:53 PM, Juan Nin  [EMAIL PROTECTED] wrote:
  Alejandro,
 
  is this needed for sqlbox to be able to connect to a remote mysql?
 
  thanks!
 
  Juan
 
  On Nov 14, 2007 1:41 PM, Alejandro Guerrieri
 
 
 
  [EMAIL PROTECTED] wrote:
   Here is my patch for sqlbox to take host into account:
  
   Index: gw/sqlbox.c
   ==
   =
   RCS file: /home/cvs/ sqlbox/gw/sqlbox.c,v
   retrieving revision 1.2
   diff -u -r1.2 sqlbox.c
   --- gw/sqlbox.c 30 May 2006 17:52:46 -   1.2
   +++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
   @@ -600,7 +600,6 @@
  
   /* some default values */
   sqlbox_port_ssl = 0;
   -   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
   bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
   bearerbox_port_ssl = 0;
   logfile = NULL;
   @@ -624,6 +623,10 @@
   if (grp == NULL)
   panic(0, No ' sqlbox' group in configuration);
  
   +   bearerbox_host = cfg_get( grp, octstr_imm(bearerbox-host));
   +   if (bearerbox_host == NULL)
   +   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
   +
   sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
   global_sender = cfg_get(grp, octstr_imm(global-sender));
  
   ===
  
   Hope it helps,
  
   Alejandro
  
  
  
   On Nov 14, 2007 1:06 PM, seik  [EMAIL PROTECTED] wrote:
I am about to do the same for sqlbox_pgsql.c :)
   
no time  so far :/
   
   
   
   
   
   
-Original Message-
From: Juan Nin [EMAIL PROTECTED] ]
Sent: 14 ??? 2007 ?.
To: seik
Subject:sqlbox does not connect to remote MySQL
   
 mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and
 modified
 the panic line in the end so the code is like here below, and the DB
 params are shown ok
   
   
 /*
  * ok, ready to connect to MySQL
  */
 db_conf = gw_malloc(sizeof(DBConf));
 gw_assert(db_conf != NULL);
   
 db_conf-mysql = gw_malloc(sizeof(MySQLConf));
 gw_assert(db_conf-mysql != NULL);
   
 db_conf-mysql-host = mysql_host;
 db_conf-mysql-username = mysql_user;
 db_conf-mysql-password = mysql_pass;
 db_conf-mysql-database = mysql_db;
 if (have_port) {
 db_conf-mysql-port = mysql_port;
 }
   
 pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
 gw_assert(pool != NULL);
   
 /*
  * XXX should a failing connect throw panic?!
  */
 if (dbpool_conn_count(pool) == 0)
 panic(0,SQLBOX: MySQL: database pool has no connections!
 host
 '%s' user '%s' pass '%s' db '%s', octstr_get_cstr(mysql_host),
 octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
 octstr_get_cstr(mysql_db));
 //panic(0,SQLBOX: MySQL: database pool has no
 connections!);
   
   
   
 On Nov 14, 2007 12:41 PM, seik  [EMAIL PROTECTED] wrote:
 Err,
 i think its the same issue as the one with the bearerbox host :/



 -Original Message-
 From: Juan Nin [EMAIL PROTECTED]
 Sent: 14 ??? 2007 ?.
 To: seik
 Subject:sqlbox does not connect to remote MySQL


  Hi!

  I'm trying sqlbox, and I can't get it to connect to a remote
 MySQL
   server...
  It's really strange...

  I got dlr-storage = mysql with the same settings and it
 connects
  fine, but sqlbox does not...
  if I run a local MySQ, using localhost it works fine, but not
 with a
  remote one...

  Here's the error I get:

  2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
  `/var/log/kannel/sqlbox.log' with level `0'.
  2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to
   database!
  2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to
 MySQL
  server on '10.10.10.2' (111)
  2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database
 pool
  has no connections!
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
  2007-11-14 08:58:06 [18604] [0] PANIC:
  /usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
  2007-11-14 08:58:06 [18604] [0] 

Re: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Alejandro Guerrieri
Hmm, pretty strange.

The only thing I can think of is about auth libraries. There's a difference
between 3.x and 4.x mysql authentication protocol, and if for some reason
the wrong protocol is used the login fails though the mysql client library
works fine.

I'd check on the remote side to see if kannel is trying to connect and, if
possible, I'd raise the log level on mysql to see if there's something on
logfiles worth noting.

Regards,

Alejandro

On Nov 14, 2007 3:10 PM, Juan Nin [EMAIL PROTECTED] wrote:

 don't think so

 on my previous post i pasted some changes i made where it logs the
 panic error, and the host, username, passwd and db are fine

 not sure where the problem is  :(


 On Nov 14, 2007 2:30 PM, Alejandro Guerrieri
 [EMAIL PROTECTED] wrote:
  No, this is to be able to connect to a remote bearerbox.
 
  Maybe there's a similar issue with mysql host? I'll check it out.
 
  Regards,
 
  Alejandro
 
 
 
  On Nov 14, 2007 1:53 PM, Juan Nin  [EMAIL PROTECTED] wrote:
   Alejandro,
  
   is this needed for sqlbox to be able to connect to a remote mysql?
  
   thanks!
  
   Juan
  
   On Nov 14, 2007 1:41 PM, Alejandro Guerrieri
  
  
  
   [EMAIL PROTECTED] wrote:
Here is my patch for sqlbox to take host into account:
   
Index: gw/sqlbox.c
==
=
RCS file: /home/cvs/ sqlbox/gw/sqlbox.c,v
retrieving revision 1.2
diff -u -r1.2 sqlbox.c
--- gw/sqlbox.c 30 May 2006 17:52:46 -   1.2
+++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
@@ -600,7 +600,6 @@
   
/* some default values */
sqlbox_port_ssl = 0;
-   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
bearerbox_port_ssl = 0;
logfile = NULL;
@@ -624,6 +623,10 @@
if (grp == NULL)
panic(0, No ' sqlbox' group in configuration);
   
+   bearerbox_host = cfg_get( grp,
 octstr_imm(bearerbox-host));
+   if (bearerbox_host == NULL)
+   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
+
sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
global_sender = cfg_get(grp, octstr_imm(global-sender));
   
===
   
Hope it helps,
   
Alejandro
   
   
   
On Nov 14, 2007 1:06 PM, seik  [EMAIL PROTECTED] wrote:
 I am about to do the same for sqlbox_pgsql.c :)

 no time  so far :/






 -Original Message-
 From: Juan Nin [EMAIL PROTECTED] ]
 Sent: 14 ??? 2007 ?.
 To: seik
 Subject:sqlbox does not connect to remote MySQL

  mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and
  modified
  the panic line in the end so the code is like here below, and
 the DB
  params are shown ok


  /*
   * ok, ready to connect to MySQL
   */
  db_conf = gw_malloc(sizeof(DBConf));
  gw_assert(db_conf != NULL);

  db_conf-mysql = gw_malloc(sizeof(MySQLConf));
  gw_assert(db_conf-mysql != NULL);

  db_conf-mysql-host = mysql_host;
  db_conf-mysql-username = mysql_user;
  db_conf-mysql-password = mysql_pass;
  db_conf-mysql-database = mysql_db;
  if (have_port) {
  db_conf-mysql-port = mysql_port;
  }

  pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
  gw_assert(pool != NULL);

  /*
   * XXX should a failing connect throw panic?!
   */
  if (dbpool_conn_count(pool) == 0)
  panic(0,SQLBOX: MySQL: database pool has no
 connections!
  host
  '%s' user '%s' pass '%s' db '%s', octstr_get_cstr(mysql_host),
  octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
  octstr_get_cstr(mysql_db));
  //panic(0,SQLBOX: MySQL: database pool has no
  connections!);



  On Nov 14, 2007 12:41 PM, seik  [EMAIL PROTECTED] wrote:
  Err,
  i think its the same issue as the one with the bearerbox host
 :/
 
 
 
  -Original Message-
  From: Juan Nin [EMAIL PROTECTED]
  Sent: 14 ??? 2007 ?.
  To: seik
  Subject:sqlbox does not connect to remote MySQL
 
 
   Hi!
 
   I'm trying sqlbox, and I can't get it to connect to a remote
  MySQL
server...
   It's really strange...
 
   I got dlr-storage = mysql with the same settings and it
  connects
   fine, but sqlbox does not...
   if I run a local MySQ, using localhost it works fine, but not
  with a
   remote one...
 
   Here's the error I get:
 
   2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
   `/var/log/kannel/sqlbox.log' with level `0'.
   2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect
 to
database!
   2007-11-14 

Re: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Juan Nin
i'm using MySql 5, but the thing is that sqlbox is not trying to
connect to the remote server

I've already enabled the mysql logging, and I see nothing, and even
more, I made a tcpdump on the remote DB server, and no packets
arrive..


On 11/14/07, Alejandro Guerrieri [EMAIL PROTECTED] wrote:
 Hmm, pretty strange.

 The only thing I can think of is about auth libraries. There's a difference
 between 3.x and 4.x mysql authentication protocol, and if for some reason
 the wrong protocol is used the login fails though the mysql client library
 works fine.

 I'd check on the remote side to see if kannel is trying to connect and, if
 possible, I'd raise the log level on mysql to see if there's something on
 logfiles worth noting.

 Regards,

 Alejandro


 On Nov 14, 2007 3:10 PM, Juan Nin [EMAIL PROTECTED] wrote:
  don't think so
 
  on my previous post i pasted some changes i made where it logs the
  panic error, and the host, username, passwd and db are fine
 
  not sure where the problem is  :(
 
 
  On Nov 14, 2007 2:30 PM, Alejandro Guerrieri
 
 
 
  [EMAIL PROTECTED] wrote:
   No, this is to be able to connect to a remote bearerbox.
  
   Maybe there's a similar issue with mysql host? I'll check it out.
  
   Regards,
  
   Alejandro
  
  
  
   On Nov 14, 2007 1:53 PM, Juan Nin  [EMAIL PROTECTED] wrote:
Alejandro,
   
is this needed for sqlbox to be able to connect to a remote mysql?
   
thanks!
   
Juan
   
On Nov 14, 2007 1:41 PM, Alejandro Guerrieri
   
   
   
[EMAIL PROTECTED] wrote:
 Here is my patch for sqlbox to take host into account:

 Index: gw/sqlbox.c
 ==
 =
 RCS file: /home/cvs/ sqlbox/gw/sqlbox.c,v
 retrieving revision 1.2
 diff -u -r1.2 sqlbox.c
 --- gw/sqlbox.c 30 May 2006 17:52:46 -   1.2
 +++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
 @@ -600,7 +600,6 @@

 /* some default values */
 sqlbox_port_ssl = 0;
 -   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
 bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
 bearerbox_port_ssl = 0;
 logfile = NULL;
 @@ -624,6 +623,10 @@
 if (grp == NULL)
 panic(0, No ' sqlbox' group in configuration);

 +   bearerbox_host = cfg_get( grp,
 octstr_imm(bearerbox-host));
 +   if (bearerbox_host == NULL)
 +   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
 +
 sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
 global_sender = cfg_get(grp, octstr_imm(global-sender));


 ===

 Hope it helps,

 Alejandro



 On Nov 14, 2007 1:06 PM, seik  [EMAIL PROTECTED] wrote:
  I am about to do the same for sqlbox_pgsql.c :)
 
  no time  so far :/
 
 
 
 
 
 
  -Original Message-
  From: Juan Nin [ [EMAIL PROTECTED] ]
  Sent: 14 ??? 2007 ?.
  To: seik
  Subject:sqlbox does not connect to remote MySQL
 
   mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and
   modified
   the panic line in the end so the code is like here below, and
 the DB
   params are shown ok
 
 
   /*
* ok, ready to connect to MySQL
*/
   db_conf = gw_malloc(sizeof(DBConf));
   gw_assert(db_conf != NULL);
 
   db_conf-mysql = gw_malloc(sizeof(MySQLConf));
   gw_assert(db_conf-mysql != NULL);
 
   db_conf-mysql-host = mysql_host;
   db_conf-mysql-username = mysql_user;
   db_conf-mysql-password = mysql_pass;
   db_conf-mysql-database = mysql_db;
   if (have_port) {
   db_conf-mysql-port = mysql_port;
   }
 
   pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
   gw_assert(pool != NULL);
 
   /*
* XXX should a failing connect throw panic?!
*/
   if (dbpool_conn_count(pool) == 0)
   panic(0,SQLBOX: MySQL: database pool has no
 connections!
   host
   '%s' user '%s' pass '%s' db '%s', octstr_get_cstr(mysql_host),
   octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
   octstr_get_cstr(mysql_db));
   //panic(0,SQLBOX: MySQL: database pool has no
   connections!);
 
 
 
   On Nov 14, 2007 12:41 PM, seik  [EMAIL PROTECTED] wrote:
   Err,
   i think its the same issue as the one with the bearerbox host
 :/
  
  
  
   -Original Message-
   From: Juan Nin [ [EMAIL PROTECTED]
   Sent: 14 ??? 2007 ?.
   To: seik
   Subject:sqlbox does not connect to remote MySQL
  
  
Hi!
  
I'm trying sqlbox, and I can't get it to connect to a remote
   MySQL
 server...
It's really strange...
  
 

RE: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Cezary Siwek


hi, 
I had the same problem.
 
you need to define port if you want to use remote db

port = 3306

(or the proper one of course)

Regards,
Cezary




-Original Message-
From: Juan Nin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 14, 2007 5:45 PM
To: users@kannel.org
Subject: Re: Re[2]: sqlbox does not connect to remote MySQL

i'm using MySql 5, but the thing is that sqlbox is not trying to connect to
the remote server

I've already enabled the mysql logging, and I see nothing, and even more, I
made a tcpdump on the remote DB server, and no packets arrive..


On 11/14/07, Alejandro Guerrieri [EMAIL PROTECTED] wrote:
 Hmm, pretty strange.

 The only thing I can think of is about auth libraries. There's a 
 difference between 3.x and 4.x mysql authentication protocol, and if 
 for some reason the wrong protocol is used the login fails though the 
 mysql client library works fine.

 I'd check on the remote side to see if kannel is trying to connect 
 and, if possible, I'd raise the log level on mysql to see if there's 
 something on logfiles worth noting.

 Regards,

 Alejandro


 On Nov 14, 2007 3:10 PM, Juan Nin [EMAIL PROTECTED] wrote:
  don't think so
 
  on my previous post i pasted some changes i made where it logs the 
  panic error, and the host, username, passwd and db are fine
 
  not sure where the problem is  :(
 
 
  On Nov 14, 2007 2:30 PM, Alejandro Guerrieri
 
 
 
  [EMAIL PROTECTED] wrote:
   No, this is to be able to connect to a remote bearerbox.
  
   Maybe there's a similar issue with mysql host? I'll check it out.
  
   Regards,
  
   Alejandro
  
  
  
   On Nov 14, 2007 1:53 PM, Juan Nin  [EMAIL PROTECTED] wrote:
Alejandro,
   
is this needed for sqlbox to be able to connect to a remote mysql?
   
thanks!
   
Juan
   
On Nov 14, 2007 1:41 PM, Alejandro Guerrieri
   
   
   
[EMAIL PROTECTED] wrote:
 Here is my patch for sqlbox to take host into account:

 Index: gw/sqlbox.c
 == 
 =
 RCS file: /home/cvs/ sqlbox/gw/sqlbox.c,v retrieving revision 
 1.2 diff -u -r1.2 sqlbox.c
 --- gw/sqlbox.c 30 May 2006 17:52:46 -   1.2
 +++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
 @@ -600,7 +600,6 @@

 /* some default values */
 sqlbox_port_ssl = 0;
 -   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
 bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
 bearerbox_port_ssl = 0;
 logfile = NULL;
 @@ -624,6 +623,10 @@
 if (grp == NULL)
 panic(0, No ' sqlbox' group in 
 configuration);

 +   bearerbox_host = cfg_get( grp,
 octstr_imm(bearerbox-host));
 +   if (bearerbox_host == NULL)
 +   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
 +
 sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
 global_sender = cfg_get(grp, 
 octstr_imm(global-sender));


 ===

 Hope it helps,

 Alejandro



 On Nov 14, 2007 1:06 PM, seik  [EMAIL PROTECTED] wrote:
  I am about to do the same for sqlbox_pgsql.c :)
 
  no time  so far :/
 
 
 
 
 
 
  -Original Message-
  From: Juan Nin [ [EMAIL PROTECTED] ]
  Sent: 14 ??? 2007 ?.
  To: seik
  Subject:sqlbox does not connect to remote MySQL
 
   mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source 
   and
   modified
   the panic line in the end so the code is like here below, 
   and
 the DB
   params are shown ok
 
 
   /*
* ok, ready to connect to MySQL
*/
   db_conf = gw_malloc(sizeof(DBConf));
   gw_assert(db_conf != NULL);
 
   db_conf-mysql = gw_malloc(sizeof(MySQLConf));
   gw_assert(db_conf-mysql != NULL);
 
   db_conf-mysql-host = mysql_host;
   db_conf-mysql-username = mysql_user;
   db_conf-mysql-password = mysql_pass;
   db_conf-mysql-database = mysql_db;
   if (have_port) {
   db_conf-mysql-port = mysql_port;
   }
 
   pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
   gw_assert(pool != NULL);
 
   /*
* XXX should a failing connect throw panic?!
*/
   if (dbpool_conn_count(pool) == 0)
   panic(0,SQLBOX: MySQL: database pool has no
 connections!
   host
   '%s' user '%s' pass '%s' db '%s', 
   octstr_get_cstr(mysql_host), octstr_get_cstr(mysql_user), 
   octstr_get_cstr(mysql_pass), octstr_get_cstr(mysql_db));
   //panic(0,SQLBOX: MySQL: database pool has no
   connections!);
 
 
 
   On Nov 14, 2007 12:41 PM, seik  [EMAIL PROTECTED] wrote:
   Err,
   i think its the same issue as the one with the bearerbox 

Re: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Juan Nin
that did it!

thanks Cezary!  :)

the port option was not mentioned on the example docs, and I hadn't
seen it on the code


On Nov 14, 2007 3:58 PM, Cezary Siwek [EMAIL PROTECTED] wrote:


 hi,
 I had the same problem.

 you need to define port if you want to use remote db

 port = 3306

 (or the proper one of course)

 Regards,
 Cezary





 -Original Message-
 From: Juan Nin [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 14, 2007 5:45 PM
 To: users@kannel.org
 Subject: Re: Re[2]: sqlbox does not connect to remote MySQL

 i'm using MySql 5, but the thing is that sqlbox is not trying to connect to
 the remote server

 I've already enabled the mysql logging, and I see nothing, and even more, I
 made a tcpdump on the remote DB server, and no packets arrive..


 On 11/14/07, Alejandro Guerrieri [EMAIL PROTECTED] wrote:
  Hmm, pretty strange.
 
  The only thing I can think of is about auth libraries. There's a
  difference between 3.x and 4.x mysql authentication protocol, and if
  for some reason the wrong protocol is used the login fails though the
  mysql client library works fine.
 
  I'd check on the remote side to see if kannel is trying to connect
  and, if possible, I'd raise the log level on mysql to see if there's
  something on logfiles worth noting.
 
  Regards,
 
  Alejandro
 
 
  On Nov 14, 2007 3:10 PM, Juan Nin [EMAIL PROTECTED] wrote:
   don't think so
  
   on my previous post i pasted some changes i made where it logs the
   panic error, and the host, username, passwd and db are fine
  
   not sure where the problem is  :(
  
  
   On Nov 14, 2007 2:30 PM, Alejandro Guerrieri
  
  
  
   [EMAIL PROTECTED] wrote:
No, this is to be able to connect to a remote bearerbox.
   
Maybe there's a similar issue with mysql host? I'll check it out.
   
Regards,
   
Alejandro
   
   
   
On Nov 14, 2007 1:53 PM, Juan Nin  [EMAIL PROTECTED] wrote:
 Alejandro,

 is this needed for sqlbox to be able to connect to a remote mysql?

 thanks!

 Juan

 On Nov 14, 2007 1:41 PM, Alejandro Guerrieri



 [EMAIL PROTECTED] wrote:
  Here is my patch for sqlbox to take host into account:
 
  Index: gw/sqlbox.c
  ==
  =
  RCS file: /home/cvs/ sqlbox/gw/sqlbox.c,v retrieving revision
  1.2 diff -u -r1.2 sqlbox.c
  --- gw/sqlbox.c 30 May 2006 17:52:46 -   1.2
  +++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
  @@ -600,7 +600,6 @@
 
  /* some default values */
  sqlbox_port_ssl = 0;
  -   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
  bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
  bearerbox_port_ssl = 0;
  logfile = NULL;
  @@ -624,6 +623,10 @@
  if (grp == NULL)
  panic(0, No ' sqlbox' group in
  configuration);
 
  +   bearerbox_host = cfg_get( grp,
  octstr_imm(bearerbox-host));
  +   if (bearerbox_host == NULL)
  +   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
  +
  sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
  global_sender = cfg_get(grp,
  octstr_imm(global-sender));
 
 
  ===
 
  Hope it helps,
 
  Alejandro
 
 
 
  On Nov 14, 2007 1:06 PM, seik  [EMAIL PROTECTED] wrote:
   I am about to do the same for sqlbox_pgsql.c :)
  
   no time  so far :/
  
  
  
  
  
  
   -Original Message-
   From: Juan Nin [ [EMAIL PROTECTED] ]
   Sent: 14 ??? 2007 ?.
   To: seik
   Subject:sqlbox does not connect to remote MySQL
  
mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source
and
modified
the panic line in the end so the code is like here below,
and
  the DB
params are shown ok
  
  
/*
 * ok, ready to connect to MySQL
 */
db_conf = gw_malloc(sizeof(DBConf));
gw_assert(db_conf != NULL);
  
db_conf-mysql = gw_malloc(sizeof(MySQLConf));
gw_assert(db_conf-mysql != NULL);
  
db_conf-mysql-host = mysql_host;
db_conf-mysql-username = mysql_user;
db_conf-mysql-password = mysql_pass;
db_conf-mysql-database = mysql_db;
if (have_port) {
db_conf-mysql-port = mysql_port;
}
  
pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
gw_assert(pool != NULL);
  
/*
 * XXX should a failing connect throw panic?!
 */
if (dbpool_conn_count(pool) == 0)
panic(0,SQLBOX: MySQL: database pool has no
  connections!
host
'%s' user '%s' pass '%s' db '%s',

RE: Re[2]: sqlbox does not connect to remote MySQL

2007-11-14 Thread Rene Kluwen
Nice hacking :)

-- Rene

-Original Message-
From: Cezary Siwek [mailto:[EMAIL PROTECTED] 
Sent: woensdag 14 november 2007 18:58
To: users@kannel.org
Subject: RE: Re[2]: sqlbox does not connect to remote MySQL




hi, 
I had the same problem.
 
you need to define port if you want to use remote db

port = 3306

(or the proper one of course)

Regards,
Cezary




-Original Message-
From: Juan Nin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 14, 2007 5:45 PM
To: users@kannel.org
Subject: Re: Re[2]: sqlbox does not connect to remote MySQL

i'm using MySql 5, but the thing is that sqlbox is not trying to connect
to the remote server

I've already enabled the mysql logging, and I see nothing, and even
more, I made a tcpdump on the remote DB server, and no packets arrive..


On 11/14/07, Alejandro Guerrieri [EMAIL PROTECTED] wrote:
 Hmm, pretty strange.

 The only thing I can think of is about auth libraries. There's a
 difference between 3.x and 4.x mysql authentication protocol, and if 
 for some reason the wrong protocol is used the login fails though the 
 mysql client library works fine.

 I'd check on the remote side to see if kannel is trying to connect
 and, if possible, I'd raise the log level on mysql to see if there's 
 something on logfiles worth noting.

 Regards,

 Alejandro


 On Nov 14, 2007 3:10 PM, Juan Nin [EMAIL PROTECTED] wrote:
  don't think so
 
  on my previous post i pasted some changes i made where it logs the
  panic error, and the host, username, passwd and db are fine
 
  not sure where the problem is  :(
 
 
  On Nov 14, 2007 2:30 PM, Alejandro Guerrieri
 
 
 
  [EMAIL PROTECTED] wrote:
   No, this is to be able to connect to a remote bearerbox.
  
   Maybe there's a similar issue with mysql host? I'll check it out.
  
   Regards,
  
   Alejandro
  
  
  
   On Nov 14, 2007 1:53 PM, Juan Nin  [EMAIL PROTECTED] wrote:
Alejandro,
   
is this needed for sqlbox to be able to connect to a remote 
mysql?
   
thanks!
   
Juan
   
On Nov 14, 2007 1:41 PM, Alejandro Guerrieri
   
   
   
[EMAIL PROTECTED] wrote:
 Here is my patch for sqlbox to take host into account:

 Index: gw/sqlbox.c
 ==
 =
 RCS file: /home/cvs/ sqlbox/gw/sqlbox.c,v retrieving revision 
 1.2 diff -u -r1.2 sqlbox.c
 --- gw/sqlbox.c 30 May 2006 17:52:46 -   1.2
 +++ gw/sqlbox.c 3 Oct 2007 13:42:58 -
 @@ -600,7 +600,6 @@

 /* some default values */
 sqlbox_port_ssl = 0;
 -   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
 bearerbox_port = BB_DEFAULT_SMSBOX_PORT;
 bearerbox_port_ssl = 0;
 logfile = NULL;
 @@ -624,6 +623,10 @@
 if (grp == NULL)
 panic(0, No ' sqlbox' group in
 configuration);

 +   bearerbox_host = cfg_get( grp,
 octstr_imm(bearerbox-host));
 +   if (bearerbox_host == NULL)
 +   bearerbox_host = octstr_create(BB_DEFAULT_HOST);
 +
 sqlbox_id = cfg_get(grp, octstr_imm(smsbox-id));
 global_sender = cfg_get(grp,
 octstr_imm(global-sender));


 ===

 Hope it helps,

 Alejandro



 On Nov 14, 2007 1:06 PM, seik  [EMAIL PROTECTED] wrote:
  I am about to do the same for sqlbox_pgsql.c :)
 
  no time  so far :/
 
 
 
 
 
 
  -Original Message-
  From: Juan Nin [ [EMAIL PROTECTED] ]
  Sent: 14 ??? 2007 ?.
  To: seik
  Subject:sqlbox does not connect to remote MySQL
 
   mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source
   and
   modified
   the panic line in the end so the code is like here below,
   and
 the DB
   params are shown ok
 
 
   /*
* ok, ready to connect to MySQL
*/
   db_conf = gw_malloc(sizeof(DBConf));
   gw_assert(db_conf != NULL);
 
   db_conf-mysql = gw_malloc(sizeof(MySQLConf));
   gw_assert(db_conf-mysql != NULL);
 
   db_conf-mysql-host = mysql_host;
   db_conf-mysql-username = mysql_user;
   db_conf-mysql-password = mysql_pass;
   db_conf-mysql-database = mysql_db;
   if (have_port) {
   db_conf-mysql-port = mysql_port;
   }
 
   pool = dbpool_create(DBPOOL_MYSQL, db_conf,
pool_size);
   gw_assert(pool != NULL);
 
   /*
* XXX should a failing connect throw panic?!
*/
   if (dbpool_conn_count(pool) == 0)
   panic(0,SQLBOX: MySQL: database pool has no
 connections!
   host
   '%s' user '%s' pass '%s' db '%s',
   octstr_get_cstr(mysql_host), octstr_get_cstr(mysql_user), 
   octstr_get_cstr(mysql_pass), octstr_get_cstr(mysql_db));
   

Connection reset by peer

2007-11-14 Thread Kudzai Gadzira
Hi all,


My smsbox disconnects its self from the bearerbox if there is no sms
recieved or sent for say aproximately 5 min. Is there a problem with
my installation or it has to do with kannel? The following error is
given:

ERROR: Error from reading fd 22:
ERROR: System error 104: Connection reset by peer


Regards,

Below is my .conf file





# This is the core group (bearerbox which is essentially the heart of Kannel)


group = core
admin-port = 13000
admin-password = bar
smsbox-port = 13001
log-file = /tmp/mobile_companion.log
#log-level = 0
box-deny-ip = *.*.*.*
box-allow-ip = 127.0.0.1


# This is the SMSC group(s). This routes sms requests to/from users to Kannel


# Fake smsc

group = smsc
smsc = fake
smsc-id = FAKE
preferred-smsc-id = mobile_companion
port = 1
sms-center = 125
connect-allow-ip = 127.0.0.1



group = smsc
smsc = at
smsc-id = mobile_companion
my-number = my_num
sms-center = my_sca
modemtype = Motorola
device = /dev/com8
sim-buffering = true
speed = 115200
connect-allow-ip = 127.0.0.1
log-level = 0

include = /usr/tmp/kannel/modems.conf


# This is the SMSbox group configuration

group = smsbox
bearerbox-host = localhost
smsbox-id = box1
sendsms-port = 13013
global-sender = Mobile Companion
log-level = 0


# sms box route

group = smsbox-route
smsbox-id = box1
smsc-ids = mobile_companion; FAKE


# SERVICES

group = sms-service
keyword = nop
max-messages = 10
catch-all = yes
#post-url = http://localhost/%S.wml;
accept-x-kannel-headers = true
concatenation = true
text = Mobile Companion!
get-url = http://localhost/%s.php/sms?phone=%ptext=%a;


# there should be default always

group = sms-service
keyword = default
text = No service specified


# SEND SMS USER FOR SMS PUSH

group = sendsms-user
faked-sender = 555
username = foo
password = bar
max-messages = 10
concatenation = true