<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Daniel,<br><br>Sorry, I was out of town for a while and just got back to this. There shouldn't be any null values in my file? The file is:<br>key_name(str) key_type(int) value_type(int) key_value(str)<br>
gwip:1:0:a<br>
gwip:1:0:b<br>
gwip:1:0:c<br>
gwcount:0:1:3<br><br>Any how, I would be happy to try the command, I am unsure of where to run 'bt full'?<br><br>Thanks,<br>Eric<br><br><hr id="stopSpelling">Date: Tue, 19 Apr 2011 10:04:39 +0200<br>From: miconda@gmail.com<br>To: mrraptor98@hotmail.com<br>CC: sr-users@lists.sip-router.org<br>Subject: Re: [SR-Users] db_text issue<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
Hello,<br>
<br>
looks like key value is null, which was not allowed by sql
constaints. I don't see a reason to be null either here, can you
send the output of 'bt full'?<br>
<br>
Anyhow, for safety reasons, I committed to htable a safety check for
such case in order to avoid crashing - now it is printing an error
message.<br>
<br>
Thanks,<br>
Daniel<br>
<br>
On 4/15/11 4:52 PM, Eric Hiller wrote:
<blockquote cite="mid:BLU166-w4746C4FA7E7D5C2BF0876DDBAC0@phx.gbl">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style>
Daniel,<br>
<br>
Same it looks like each time:<br>
<br>
Core was generated by `/usr/local/sbin/kamailio -f
/usr/local/etc/kamailio/kamailio.cfg.diag.2'.<br>
Program terminated with signal 11, Segmentation fault.<br>
#0 0x00f22633 in ht_db_load_table (ht=0xb60f1af0,
dbtable=0xb60f1b00, mode=0)<br>
at ht_db.c:244<br>
244 kvalue.len = strlen(kvalue.s);<br>
(gdb) where<br>
#0 0x00f22633 in ht_db_load_table (ht=0xb60f1af0,
dbtable=0xb60f1b00, mode=0)<br>
at ht_db.c:244<br>
#1 0x00f19c12 in ht_db_load_tables () at ht_api.c:643<br>
#2 0x00f18545 in mod_init () at htable.c:157<br>
#3 0x081043a2 in init_mod (m=0x827ae30) at sr_module.c:872<br>
#4 0x0810436a in init_mod (m=0x827aff0) at sr_module.c:852<br>
#5 0x0810436a in init_mod (m=0x827b0d0) at sr_module.c:852<br>
#6 0x0810436a in init_mod (m=0x827b1b0) at sr_module.c:852<br>
#7 0x0810436a in init_mod (m=0x827b290) at sr_module.c:852<br>
#8 0x0810436a in init_mod (m=0x827b370) at sr_module.c:852<br>
#9 0x081051d3 in init_modules () at sr_module.c:902<br>
#10 0x0809b6a5 in main (argc=3, argv=0xbfcc2464) at main.c:2187<br>
<br>
<hr id="ecxstopSpelling">Date: Fri, 15 Apr 2011 09:30:02 +0200<br>
From: <a class="ecxmoz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a><br>
To: <a class="ecxmoz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
CC: <a class="ecxmoz-txt-link-abbreviated" href="mailto:mrraptor98@hotmail.com">mrraptor98@hotmail.com</a><br>
Subject: Re: [SR-Users] db_text issue<br>
<br>
Hello,<br>
<br>
On 4/15/11 5:58 AM, Eric Hiller wrote:
<blockquote cite="mid:BLU166-w1631043E256A79255714A7DBAC0@phx.gbl">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style> I would like to use dbtext to store a list of whitelisted
gateways, but each time I load it I get a core segmentation
fault.<br>
<br>
Any ideas? Here is my gateways db file:<br>
key_name(str) key_type(int) value_type(int) key_value(str)<br>
gwip:1:0:a<br>
gwip:1:0:b<br>
gwip:1:0:c<br>
gwcount:0:1:3<br>
<br>
And in my config:<br>
modparam("htable","htable","gateways=>size=4;dbtable=gateways;")<br>
modparam("htable","db_url","text:///usr/local/etc/kamailio")<br>
<br>
while( $var(i) < $sht(gateways=>gwcount)
){<br>
if( $sht(gateways=>gwip[$var(i)]) ==
$si ){<br>
setflag(gateway);<br>
xlog("ISFROMGW: request from IP
$si matches $sht(gateways=>gwip[$var(i)]) ...\n");<br>
}<br>
}<br>
<br>
Do you see anything wrong with this setup?<br>
</blockquote>
do you get a core dump? Send the backtrace if yes.<br>
<br>
Cheers,<br>
Daniel<br>
<pre class="ecxmoz-signature">--
Daniel-Constantin Mierla
<a class="ecxmoz-txt-link-freetext" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
</blockquote>
<br>
<pre class="ecxmoz-signature">--
Daniel-Constantin Mierla
<a class="ecxmoz-txt-link-freetext" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre> </body>
</html>