Re: [PATCH] get catenated sms work right

2004-08-26 Thread Alexander Malysh
Hi Stipe,

Stipe Tolj wrote:

 Alexander Malysh wrote:
 
 Hi List,
 
 attached you can find a patch that implements catenation of large sms
 inside of bearerbox and does care of a sending of all message parts over
 one smsc link. Now we have a problem with catenated large sms that
 bearerbox will try to load balance those over diff. smsc links and such
 messages arrive as junk (_all_ parts of catenated large sms _must_ go
 through the same smsc). we avoid such a problems now with a config
 workarounds (allowed/denied/etc.-smsc-id), but here is a clean solution
 attached;)
 
 Please review/comment/ask/vote!
 
 P.S. idea was stolen from netikos gateway, so I must say: thank you guys!
 
 without digging into the patch for review (for now ;), is it simply
 Netikos version addopted, or does it utilize something differently?

no it's not a simply adopted netikos version... this version based on
netikos idea and does the same think, but implementation differ.

Btw. pease fix your gpg signature or disable it:) it's not rfc conform...

 
 Stipe
 
 mailto:stolj_{at}_wapme.de
 ---
 Wapme Systems AG
 
 Vogelsanger Weg 80
 40470 Düsseldorf, NRW, Germany
 
 phone: +49.211.74845.0
 fax: +49.211.74845.299
 
 mailto:info_{at}_wapme-systems.de
 http://www.wapme-systems.de/
 ---
 
-- 
Thanks,
Alex




Re: [PATCH] get catenated sms work right

2004-08-26 Thread Alexander Malysh
Hi Stipe,

Stipe Tolj wrote:

 Alexander Malysh wrote:
 
 Hi List,
 
 attached you can find a patch that implements catenation of large sms
 inside of bearerbox and does care of a sending of all message parts over
 one smsc link. Now we have a problem with catenated large sms that
 bearerbox will try to load balance those over diff. smsc links and such
 messages arrive as junk (_all_ parts of catenated large sms _must_ go
 through the same smsc). we avoid such a problems now with a config
 workarounds (allowed/denied/etc.-smsc-id), but here is a clean solution
 attached;)
 
 Please review/comment/ask/vote!
 
 P.S. idea was stolen from netikos gateway, so I must say: thank you guys!
 
 without digging into the patch for review (for now ;), is it simply
 Netikos version addopted, or does it utilize something differently?

no it's not a simply adopted netikos version... this version based on
netikos idea and does the same think, but implementation differ.

Btw. pease fix your gpg signature or disable it:) it's not rfc conform...

 
 Stipe
 
 mailto:stolj_{at}_wapme.de
 ---
 Wapme Systems AG
 
 Vogelsanger Weg 80
 40470 Düsseldorf, NRW, Germany
 
 phone: +49.211.74845.0
 fax: +49.211.74845.299
 
 mailto:info_{at}_wapme-systems.de
 http://www.wapme-systems.de/
 ---

-- 
Thanks,
Alex




Problem with memoryleak in octstr

2004-08-26 Thread Ken A. Redergård
Hi,
I'm trying to figure out why the following octstr function leak 1 byte 
of memory for each iteration:

/* test_octstr.c */
#include unistd.h
#include gwlib/gwlib.h
int main(void) {
 Octstr *os;
 int i;
 gwlib_init();
 for (i = 0; i  100; i++) {
   os = octstr_format(sadfasdfasdfas);
   octstr_append(os, octstr_imm(asdfasdfasdfasdf));
   octstr_destroy(os);
   gwthread_sleep(1);
 }
 gwlib_shutdown();
 return 0;
}
Watching this with ps -C test_octstr -F shows that for every four 
seconds it leaks 4 bytes... Is the use of octstr incorrect or is it a 
problem in gwlib ?

With regards,
-Ken.


Re: Problem compiling with MySql support

2004-08-26 Thread James Coleman
Hi Alejandro, Stipe,

I think I see the same thing as Alejandro?
kannel 1.3.2 and cvs head with mysql, redhat 9.1.

From Alejandro's original msg:

Configuring DB support ...
checking whether to compile with MySQL support... searching
checking for mysql_config... /usr/bin/mysql_config
checking mysql version... 3.23.58
checking mysql
libs...  -L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm
checking for mysql_init in -lmysqlclient... no
configure: error: Unable to find MySQL client libraries

And me:

[EMAIL PROTECTED] ~/src/kannel/gateway-cvshead/$ ./configure --disable-ssl 
--with-mysql --with-mysql-dlr=/usr
creating cache ./config.cache
checking cvs checkout date... 20040826
.

Configuring DB support ...
checking whether to compile with MySQL support... searching
checking for mysql_config... /usr/bin/mysql_config
checking mysql version... 3.23.58
checking mysql libs...  -L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm 
checking for mysql_init in -lmysqlclient... no
configure: error: Unable to find MySQL client libraries

[EMAIL PROTECTED] ~/src/kannel/gateway-cvshead/$ tail -n 20 config.log
configure:4500: checking for mysql_init in -lmysqlclient
configure:4519: gcc -o conftest  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE 
-I/usr/include/libxml2   -rdynamic conftest.c -lmysqlclient  -L'/usr/lib/mysql' 
-lmysqlclient -lz -lcrypt -lnsl -lm  -lresolv -lnsl -lm  -lpthread -L/usr/lib -lxml2 
-lz -lm 15
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 4508 configure
#include confdefs.h
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply.  */
char mysql_init();

int main() {
mysql_init()
; return 0; }

[EMAIL PROTECTED] ~/src/kannel/gateway-cvshead/$ ls /usr/lib/mysql
libdbug.a libmysqlclient_r.a  libmysqlclient.so.10.0.0
libheap.a libmysqlclient_r.so libmystrings.a
libmerge.alibmysqlclient_r.so.10  libmysys.a
libmyisam.a   libmysqlclient_r.so.10.0.0  libnisam.a
libmyisammrg.alibmysqlclient.so
libmysqlclient.a  libmysqlclient.so.10

[EMAIL PROTECTED] ~/src/kannel/gateway-1.3.2rc1/$ ls /usr/include/mysql/
dbug.h  my_config.h  my_no_pthread.h  mysql.h  sslopt-case.h
errmsg.hmy_global.h  my_pthread.h mysql_version.h  sslopt-longopts.h
m_ctype.h   my_list.hmysql_com.h  my_sys.h sslopt-usage.h
m_string.h  my_net.h mysqld_error.h   raid.h   sslopt-vars.h


The configure options for mysql in 1.2.1 were different 

[EMAIL PROTECTED] ~/src/kannel/gateway-1.2.1/$ 
./configure --disable-ssl --with-mysql=/usr --enable-mysql --with-dlr=mysql

Configuring DB support ...
checking whether to compile with MySQL support... searching in /usr
checking for /usr/include/mysql/mysql.h... yes
checking for mysql/mysql.h... yes
checking for mysql/mysql_com.h... yes
checking for mysql/mysql_version.h... yes
checking for mysql_init in -lmysqlclient... yes
checking whether to compile with MySQL support... yes
checking whether to compile with LibSDB support... disabled

I just did that now and build so mysql definately alright.



I argued a bit with the configure script and looked inside it.
I do think there is an error there ... but well my poor little head is getting 
confused!
Where kannel configure is testing mysql and figuring out stuff
 it does some tests on gcc and ... well it is a bit convoluted/complicated
 right there and I'm struggling.
But anyway in the configure gcc test for musql_init ... something slightly
 weird happens.




On the commandline with that c prog and confdefs.h the following line is good:

gcc -o conftest  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -I/usr/include/libxml2   -rdynamic 
conftest.c -lmysqlclient  -L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm  
-lresolv -lnsl -lm  -lpthread -L/usr/lib -lxml2 -lz -lm 

doesn't report /usr/bin/ld: cannot find -lmysqlclient

BUT that is what seems to happen when that gcc line is called from the configure 
script.

SO ... ??? could it be the  -L'/usr/lib/mysql'  those single quotes?
I've looked but nasty to find exactly where that is set in $LIBS

If I do a HUGE cheat and after the test force it to be a success then
kannel build is good. (last two lines of snippet here:)


echo $ac_n checking for mysql_init in -lmysqlclient... $ac_c 16
echo configure:4500: checking for mysql_init in -lmysqlclient 5
ac_lib_var=`echo mysqlclient'_'mysql_init | sed 'y%./+-%__p_%'`
if eval test \`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\ = set; then
  echo $ac_n (cached) $ac_c 16
else
  ac_save_LIBS=$LIBS
LIBS=-lmysqlclient  $MYSQL_LIBS  $LIBS
cat  conftest.$ac_ext EOF
#line 4508 configure
#include confdefs.h
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
builtin and then its argument

Re: Problem compiling with MySql support

2004-08-26 Thread Alejandro Guerrieri
James,

As I see, I´m not alone after all! It seems something is clashing between
RedHat 9/9.1 and the configure stuff...

I also noticed that the check that fails on the configure script runs ok
from the command line. Pretty weird huh? :)

I'll be trying today to find out where the problem is. I'll post the list if
I find anything.

Regards,

- Original Message - 
From: James Coleman [EMAIL PROTECTED]
To: Alejandro Guerrieri [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 26, 2004 3:42 PM
Subject: Re: Problem compiling with MySql support


 Hi Alejandro, Stipe,

 I think I see the same thing as Alejandro?
 kannel 1.3.2 and cvs head with mysql, redhat 9.1.

 From Alejandro's original msg:

 Configuring DB support ...
 checking whether to compile with MySQL support... searching
 checking for mysql_config... /usr/bin/mysql_config
 checking mysql version... 3.23.58
 checking mysql
 libs...  -L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm
 checking for mysql_init in -lmysqlclient... no
 configure: error: Unable to find MySQL client libraries

 And me:

 [EMAIL PROTECTED] ~/src/kannel/gateway-cvshead/$
./configure --disable-ssl --with-mysql --with-mysql-dlr=/usr
 creating cache ./config.cache
 checking cvs checkout date... 20040826
 .

 Configuring DB support ...
 checking whether to compile with MySQL support... searching
 checking for mysql_config... /usr/bin/mysql_config
 checking mysql version... 3.23.58
 checking mysql
libs...  -L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm
 checking for mysql_init in -lmysqlclient... no
 configure: error: Unable to find MySQL client libraries

 [EMAIL PROTECTED] ~/src/kannel/gateway-cvshead/$ tail -n 20 config.log
 configure:4500: checking for mysql_init in -lmysqlclient
 configure:4519: gcc -o
conftest  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -I/usr/include/libxml2   -rdynam
ic
conftest.c -lmysqlclient  -L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl
 -lm  -lresolv -lnsl -lm  -lpthread -L/usr/lib -lxml2 -lz -lm 15
 /usr/bin/ld: cannot find -lmysqlclient
 collect2: ld returned 1 exit status
 configure: failed program was:
 #line 4508 configure
 #include confdefs.h
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 builtin and then its argument prototype would still apply.  */
 char mysql_init();

 int main() {
 mysql_init()
 ; return 0; }

 [EMAIL PROTECTED] ~/src/kannel/gateway-cvshead/$ ls /usr/lib/mysql
 libdbug.a libmysqlclient_r.a  libmysqlclient.so.10.0.0
 libheap.a libmysqlclient_r.so libmystrings.a
 libmerge.alibmysqlclient_r.so.10  libmysys.a
 libmyisam.a   libmysqlclient_r.so.10.0.0  libnisam.a
 libmyisammrg.alibmysqlclient.so
 libmysqlclient.a  libmysqlclient.so.10

 [EMAIL PROTECTED] ~/src/kannel/gateway-1.3.2rc1/$ ls /usr/include/mysql/
 dbug.h  my_config.h  my_no_pthread.h  mysql.h  sslopt-case.h
 errmsg.hmy_global.h  my_pthread.h mysql_version.h
sslopt-longopts.h
 m_ctype.h   my_list.hmysql_com.h  my_sys.h sslopt-usage.h
 m_string.h  my_net.h mysqld_error.h   raid.h   sslopt-vars.h


 The configure options for mysql in 1.2.1 were different 

 [EMAIL PROTECTED] ~/src/kannel/gateway-1.2.1/$

./configure --disable-ssl --with-mysql=/usr --enable-mysql --with-dlr=mysql

 Configuring DB support ...
 checking whether to compile with MySQL support... searching in /usr
 checking for /usr/include/mysql/mysql.h... yes
 checking for mysql/mysql.h... yes
 checking for mysql/mysql_com.h... yes
 checking for mysql/mysql_version.h... yes
 checking for mysql_init in -lmysqlclient... yes
 checking whether to compile with MySQL support... yes
 checking whether to compile with LibSDB support... disabled

 I just did that now and build so mysql definately alright.



 I argued a bit with the configure script and looked inside it.
 I do think there is an error there ... but well my poor little head is
getting confused!
 Where kannel configure is testing mysql and figuring out stuff
  it does some tests on gcc and ... well it is a bit convoluted/complicated
  right there and I'm struggling.
 But anyway in the configure gcc test for musql_init ... something slightly
  weird happens.




 On the commandline with that c prog and confdefs.h the following line is
good:

 gcc -o
nftest  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -I/usr/include/libxml2   -rdynamic
conftest.c -lmysqlclient  -L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl
 -lm  -lresolv -lnsl -lm  -lpthread -L/usr/lib -lxml2 -lz -lm

 doesn't report /usr/bin/ld: cannot find -lmysqlclient

 BUT that is what seems to happen when that gcc line is called from the
configure script.

 SO ... ??? could it be the  -L'/usr/lib/mysql'  those single quotes?
 I've looked but nasty to find exactly where that is set in $LIBS

 If I do a HUGE cheat and after the test force it to be a success then
 kannel build is good

Re: Problem with memoryleak in octstr

2004-08-26 Thread Stipe Tolj
Ken A. Redergård wrote:
Hi,
I'm trying to figure out why the following octstr function leak 1 byte 
of memory for each iteration:

/* test_octstr.c */
#include unistd.h
#include gwlib/gwlib.h
int main(void) {
 Octstr *os;
 int i;
 gwlib_init();
 for (i = 0; i  100; i++) {
   os = octstr_format(sadfasdfasdfas);
   octstr_append(os, octstr_imm(asdfasdfasdfasdf));
   octstr_destroy(os);
   gwthread_sleep(1);
 }
 gwlib_shutdown();
 return 0;
}
Watching this with ps -C test_octstr -F shows that for every four 
seconds it leaks 4 bytes... Is the use of octstr incorrect or is it a 
problem in gwlib ?
hmm, I tried this with valgrind and get the following:
$ valgrind --tool=memcheck --leak-check=yes ./test/test_octstr
==9563== Memcheck, a memory error detector for x86-linux.
==9563== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==9563== Using valgrind-2.1.2, a program supervision framework for 
x86-linux.
==9563== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==9563== For more details, rerun with: -v
==9563==
==9563== warning: Valgrind's pthread_cond_destroy is incomplete
==9563==  (it doesn't check if the cond is waited on)
==9563==  your program may misbehave as a result
==9563== warning: Valgrind's pthread_cond_destroy is incomplete
==9563==  (it doesn't check if the cond is waited on)
==9563==  your program may misbehave as a result
==9563== warning: Valgrind's pthread_cond_destroy is incomplete
==9563==  (it doesn't check if the cond is waited on)
==9563==  your program may misbehave as a result
2004-08-26 18:01:21 [9563] [0] DEBUG: Immutable octet strings: 1.
==9563==
==9563== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 28 from 2)
==9563== malloc/free: in use at exit: 1200 bytes in 29 blocks.
==9563== malloc/free: 11184 allocs, 11155 frees, 717508 bytes allocated.
==9563== For counts of detected errors, rerun with: -v
==9563== searching for pointers to 29 not-freed blocks.
==9563== checked 5445108 bytes.
==9563==
==9563== LEAK SUMMARY:
==9563==definitely lost: 0 bytes in 0 blocks.
==9563==possibly lost:   0 bytes in 0 blocks.
==9563==still reachable: 1000 bytes in 28 blocks.
==9563== suppressed: 200 bytes in 1 blocks.
==9563== Reachable blocks (those to which a pointer was found) are not 
shown.
==9563== To see them, rerun with: --show-reachable=yes

So valgrind seems _not_ to see any leaking.
Stipe
mailto:stolj_{at}_wapme.de
---
Wapme Systems AG
Vogelsanger Weg 80
40470 Düsseldorf, NRW, Germany
phone: +49.211.74845.0
fax: +49.211.74845.299
mailto:info_{at}_wapme-systems.de
http://www.wapme-systems.de/
---
-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.2.2 (Cygwin)
mIsEP6mcYwEEAMDnUiUwrbb+xwTFWN6TxF2+XZu7/alwJMeCwMBRvXtPZqfjpPhS
OkBpU0F4TrVuugz1HINTSaJTYq10AzDQXp5NkyWgckqW79nPAWuOX0dicbJk+cN2
nM2TI4KaxUDe6u8hghNEnH/i2lXsUu9apnP/iixzV81VC2je3uc9hZpnAAYptEVT
dGlwZSBUb2xqIChUZWNobm9sb2d5IENlbnRlciAmIFJlc2VhcmNoIExhYikgPHRv
bGpAd2FwbWUtc3lzdGVtcy5kZT6ItAQTAQIAHgUCP6mcYwIbAwYLCQgHAwIDFQID
AxYCAQIeAQIXgAAKCRABV0w1BqPYRuSqA/wPzsQxao2YePENCtgRTrO86U6zg3sl
OcS6CJFI4FZP5h/xD3GRsNH1+MPSvZlomDdpFnr547DGz/Kq9MXuQwVvlVig5yWZ
K5dtKp1r5YLhxJQBhfirZbRFFnYmf19f18J8OoS28tuFVftDl1AIwJS3HLyBTv6H
g2HyLAEKQIp30Q==
=aYCI
-END PGP PUBLIC KEY BLOCK-


Re: Question about routing

2004-08-26 Thread Stipe Tolj
Oscar Medina Duarte wrote:
Hello !
I'm not getting what I want I don't know what is missing, I have 5 smsc
connections, configured that bound correctly, and only one smsbox that
gets all the messages, and that is working fine. The problem is that
outbound messages are not sent, with the message :
...
2004-08-26 13:11:59 [9373] [2] DEBUG: HTTP: Creating HTTPClient for `an
IP'.
2004-08-26 13:11:59 [9373] [3] DEBUG: HTTP: Resetting HTTPClient for
`an IP'.
2004-08-26 13:12:44 [9373] [4] WARNING: smsbox_list empty!
2004-08-26 13:12:44 [9373] [4] WARNING: smsbox_list empty!
2004-08-26 13:12:50 [9373] [3] DEBUG: HTTP: Resetting HTTPClient for
`an IP'.
2004-08-26 13:13:38 [9373] [12] DEBUG: boxc_receiver: sms received
2004-08-26 13:13:38 [9373] [12] WARNING: Cannot find SMSCConn for
message to a telephone, rejected.
2004-08-26 13:13:38 [9373] [12] WARNING: Message rejected by bearerbox,
no router!
2004-08-26 13:13:38 [9373] [12] DEBUG: send_msg: sending msg to boxc:
smsbox_01
2004-08-26 13:13:44 [9373] [4] WARNING: smsbox_list empty!
2004-08-26 13:13:44 [9373] [4] WARNING: smsbox_list empty!
...
at the bearerbox, as you can see, I'm using sendsms to out bind
messages, but that is not working.
NOTE: The data included within  and  is data that depending on its
context may be an IP, password, phone number, etc...
Thanks !!
== Oscar

##
###bearerbox.conf  ###
###  Author: Oscar Medina 
##
###
Core ##
###
group = core
admin-port = some_data
admin-password = some_data
status-password = some_data
admin-deny-ip = *.*.*.*
admin-allow-ip = 127.0.0.1;some_IP
smsbox-port = some_port
box-deny-ip = *.*.*.*
box-allow-ip = 127.0.0.1;some_IP
log-level = 0
log-file = logs/bearerbox.log
access-log = logs/bearerbox.access


#   SMSC's #


## SMSC: test ##
## Number:   some_data  ##
## smscID:   some_data  ##

group = smsc
smsc = smpp
smsc-id = smsc_1
denied-smsc-id = smsc_2;smsc_3;smsc_4;smsc_5
allowed-smsc-id = smsc_1
preferred-smsc-id = smsc_1
host = some_IP
#host = localhost
port = some_port
transceiver-mode = true
smsc-username = some_data
smsc-password = some_data
system-type = VMA
interface-version = 0x34
enquire-link-interval = 60
max-pending-submits = 10
reconnect-delay = 30
source-addr-ton = 0
source-addr-npi = 1
source-addr-autodetect = true
dest-addr-ton = 2
dest-addr-npi = 1
log-level = 0
log-file = logs/smsc_TelcelTest.log
... plus other 4 smsc's with the same kind of config,
from with the corresponding smscID... 
config looks good. This is a more semantical problem.
Your smsc groups do 'allow-smsc-id = smsc-id' which means, only a 
message carrying this smsc-id will be allowed to be passed to this 
smsc link.

So, if you call the sendsms HTTP interface _without_ the 
'smsc=foobar' parameter, this would result exactly in the no 
router error message inside the main routing facility of bearerbox.

Actually you are trying to send messages without specifying which 
way to go, but on the other hand, do require (with the 
allowed-smsc-id) the smsc links to have that specification.

Stipe
mailto:stolj_{at}_wapme.de
---
Wapme Systems AG
Vogelsanger Weg 80
40470 Düsseldorf, NRW, Germany
phone: +49.211.74845.0
fax: +49.211.74845.299
mailto:info_{at}_wapme-systems.de
http://www.wapme-systems.de/
---
-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.2.2 (Cygwin)
mIsEP6mcYwEEAMDnUiUwrbb+xwTFWN6TxF2+XZu7/alwJMeCwMBRvXtPZqfjpPhS
OkBpU0F4TrVuugz1HINTSaJTYq10AzDQXp5NkyWgckqW79nPAWuOX0dicbJk+cN2
nM2TI4KaxUDe6u8hghNEnH/i2lXsUu9apnP/iixzV81VC2je3uc9hZpnAAYptEVT
dGlwZSBUb2xqIChUZWNobm9sb2d5IENlbnRlciAmIFJlc2VhcmNoIExhYikgPHRv
bGpAd2FwbWUtc3lzdGVtcy5kZT6ItAQTAQIAHgUCP6mcYwIbAwYLCQgHAwIDFQID
AxYCAQIeAQIXgAAKCRABV0w1BqPYRuSqA/wPzsQxao2YePENCtgRTrO86U6zg3sl
OcS6CJFI4FZP5h/xD3GRsNH1+MPSvZlomDdpFnr547DGz/Kq9MXuQwVvlVig5yWZ
K5dtKp1r5YLhxJQBhfirZbRFFnYmf19f18J8OoS28tuFVftDl1AIwJS3HLyBTv6H
g2HyLAEKQIp30Q==
=aYCI
-END PGP PUBLIC KEY BLOCK-