<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hello,<br>
<br>
On 11/23/10 12:36 PM, Javier Gallart wrote:
<blockquote
cite="mid:AANLkTi=pH4Tv1rDTZX3xHqB6_WpE1WZweb5XADzA83V3@mail.gmail.com"
type="cite">Hi,
<div><br>
</div>
<div>same result after adding a second row in the table.</div>
</blockquote>
I just did a configuration file with dialplan and a record like you
showed and it started ok. My log messages are pasted next:<br>
<br>
0(10267) DEBUG: db_mysql [km_res.c:136]: use DB1_STRING result type<br>
0(10267) DEBUG: db_mysql [km_dbase.c:354]: converting row 0 of 1
count 1<br>
0(10267) DEBUG: <core> [db_row.c:119]: allocate 160 bytes for
row values at 0x82f53f4<br>
0(10267) DEBUG: <core> [db_val.c:73]: converting INT [1]<br>
0(10267) DEBUG: <core> [db_val.c:73]: converting INT [1]<br>
0(10267) DEBUG: <core> [db_val.c:73]: converting INT [1]<br>
0(10267) DEBUG: <core> [db_val.c:117]: converting STRING
[^00]<br>
0(10267) DEBUG: <core> [db_val.c:73]: converting INT [0]<br>
0(10267) DEBUG: <core> [db_val.c:117]: converting STRING
[^00]<br>
0(10267) DEBUG: <core> [db_val.c:117]: converting STRING
[011]<br>
0(10267) DEBUG: <core> [db_val.c:117]: converting STRING
[dp1]<br>
0(10267) DEBUG: dialplan [dp_db.c:387]: build_rule<br>
0(10267) DEBUG: dialplan [dp_db.c:447]: attrs are dp1<br>
0(10267) DEBUG: dialplan [dp_db.c:493]: new dpl_id 1<br>
0(10267) DEBUG: dialplan [dp_db.c:506]: new index , len 0<br>
0(10267) DEBUG: dialplan [dp_db.c:542]: added the rule id 1 index 0
pr 1 next (nil) to the index with 0 len<br>
0(10267) DEBUG: <core> [db_res.c:54]: freeing 1 rows<br>
<br>
Is it a fresh installation or an update over an older installation?
If is the second, can you doublecheck to see if all modules were
compiled and installed at the same time and are no longer older
versions?<br>
<br>
Also, what is your operating system and architecture type?<br>
<br>
I tried with both master/devel and 3.1 branches.<br>
<br>
Thanks,<br>
Daniel<br>
<br>
<blockquote
cite="mid:AANLkTi=pH4Tv1rDTZX3xHqB6_WpE1WZweb5XADzA83V3@mail.gmail.com"
type="cite">
<div><br>
</div>
<div>Regards</div>
<div><br>
</div>
<div>Javier<br>
<br>
<div class="gmail_quote">On Tue, Nov 23, 2010 at 11:17 AM,
Daniel-Constantin Mierla <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000"> Thanks, I will look
over it and try to reproduce in the lab, it may take a bit
since I am pretty much time offline these days.<br>
<br>
Can you add a second rule and see what happens? At the
first sight of the debug messages, the result from
database is ok, should not be a null value there.<br>
<br>
Cheers,<br>
<font color="#888888"> Daniel</font>
<div>
<div class="h5"><br>
<br>
On 11/23/10 10:38 AM, Javier Gallart wrote:
<blockquote type="cite">Thanks Daniel
<div><br>
</div>
<div>you can find both the gdb and ./kamailio output
at <a moz-do-not-send="true"
href="http://pastebin.ca/1999786"
target="_blank">http://pastebin.ca/1999786</a></div>
<div><br>
</div>
<div>Regards</div>
<div><br>
</div>
<div>Javier<br>
<br>
<div class="gmail_quote">On Mon, Nov 22, 2010 at
10:19 PM, Daniel-Constantin Mierla <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:miconda@gmail.com"
target="_blank">miconda@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:
0pt 0pt 0pt 0.8ex; border-left: 1px solid
rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000"> Hello,
<div><br>
<br>
On 11/22/10 5:32 PM, Javier Gallart wrote:
<blockquote type="cite">Hello
<div><br>
</div>
<div>I'd like to do some tests with the
dialplan module, but Kamailio is
crashing when it loads it. Actually
the module is properly loaded if the
table is empty, but it fails when a
row is added; so I guess it's related
with the way I've inserted the values.
A core file is generated:</div>
<div>
<div><br>
</div>
<div>Core was generated by `./kamailio
-f ../etc/kamailio/kamailio.cfg'.</div>
<div>Program terminated with signal
11, Segmentation fault.</div>
<div>#0 build_rule (values=0x0) at
dp_db.c:439</div>
<div> 439<span style="white-space:
pre-wrap;"> </span>new_rule->dpid<span
style="white-space: pre-wrap;"> </span>=<span
style="white-space: pre-wrap;"> </span>VAL_INT(values);</div>
</div>
</blockquote>
</div>
this looks a bit strange at first sight,
'values' parameter is NULL and should not
happen. Besides that, in build_rule()
functions there are other uses of 'values'
before line 439, so the crash should have
been earlier.<br>
<br>
Please send full backtrace of the core, in
gdb, run 'bt' command (or better 'bt full').<br>
<br>
Also, if this reproducible, run:<br>
<br>
./kamailio -f ../etc/kamailio/kamailio.cfg
-E -dddd<br>
<br>
and send the output.<br>
<br>
Cheers,<br>
Daniel<br>
<blockquote type="cite">
<div>
<div>
<div> </div>
<div><br>
</div>
<div>This is the relevant config:</div>
<div><br>
</div>
<div>
<div>#----- dialplan params ---</div>
<div>modparam("dialplan", "db_url",
"mysql://xxxx:yyyyy@localhost/db")</div>
<div>modparam("dialplan",
"table_name", "dialplan")</div>
<div>modparam("dialplan",
"dpid_col", "dpid")</div>
<div>modparam("dialplan",
"attrs_pvar", "$avp(s:dp_attrs)")</div>
</div>
<div><br>
</div>
<div>mysql> describe dialplan;</div>
<div>
<div>+-----------+------------------+------+-----+---------+----------------+</div>
<div>| Field | Type
| Null | Key | Default | Extra
|</div>
<div>+-----------+------------------+------+-----+---------+----------------+</div>
<div>| id | int(10) unsigned
| NO | PRI | NULL |
auto_increment |</div>
<div>| dpid | int(11)
| NO | | NULL |
|</div>
<div>| pr | int(11)
| NO | | NULL |
|</div>
<div>| match_op | int(11)
| NO | | NULL |
|</div>
<div>| match_exp | varchar(64)
| NO | | NULL |
|</div>
<div>| match_len | int(11)
| NO | | NULL |
|</div>
<div>| subst_exp | varchar(64)
| NO | | NULL |
|</div>
<div>| repl_exp | varchar(32)
| NO | | NULL |
|</div>
<div>| attrs | varchar(32)
| NO | | NULL |
|</div>
<div>+-----------+------------------+------+-----+---------+----------------+</div>
<div>9 rows in set (0.00 sec)</div>
</div>
<div>
<div><br>
</div>
<div>mysql> select * from
dialplan;</div>
<div>+----+------+----+----------+-----------+-----------+-----------+----------+-------+</div>
<div>| id | dpid | pr | match_op |
match_exp | match_len | subst_exp
| repl_exp | attrs |</div>
<div>+----+------+----+----------+-----------+-----------+-----------+----------+-------+</div>
<div>| 1 | 1 | 1 | 1 |
^00 | 0 | ^00
| 011 | dp1 |</div>
<div>+----+------+----+----------+-----------+-----------+-----------+----------+-------+</div>
<div>1 row in set (0.00 sec)</div>
</div>
<div><br>
</div>
<div>I'm probably making some stupid
mistake...any clue?</div>
<div><br>
</div>
<div>Thanks in advance</div>
<div><br>
</div>
<div>Javier</div>
</div>
</div>
<pre><fieldset></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
</div>
</blockquote>
</div>
<br>
</div>
<pre><fieldset></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
</body>
</html>