<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta name="Generator" content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang="ES-CL" link="blue" vlink="purple"><div class="WordSection1"><p class="MsoNormal"><span lang="EN-US">Hello, </span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal">
<span lang="EN-US">I´m using Kamalio 3.1.0 and want to alter some databases (mysql) tables at kamailio starts. I read that the route event_route[htable:mod-init] allows me to do that, but i´m having some problems. </span></p>
<p class="MsoNormal"><span lang="EN-US">I load htable.so module and insert the event_route[] in mi kamailio.conf script but when I start kamailio it returns an error: </span></p><p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): usrloc </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): registrar </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): uri_db </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): domain </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): permissions </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): group </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): mi_fifo </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): avpops </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): dialog </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): lcr </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): sqlops </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): rtimer </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [sr_module.c:828]: DEBUG: init_mod_child (-127): htable </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: htable [htable.c:185]: rank is (-127) </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: htable [htable.c:191]: executing event_route[htable:mod-init] (1) </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [parser/msg_parser.c:630]: SIP Request: </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [parser/msg_parser.c:632]: method: <OPTIONS> </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [parser/msg_parser.c:634]: uri: <<a href="mailto:sip%3Ayou@kamailio.org">sip:you@kamailio.org</a>> </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [parser/msg_parser.c:636]: version: <SIP/2.0> </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: <core> [mem/q_malloc.c:366]: qm_malloc(0x82bbfa0, 32) called from <core>: parser/msg_parser.c: parse_headers(341) </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: <core> [mem/q_malloc.c:406]: qm_malloc(0x82bbfa0, 32) returns address 0x834f780 frag. 0x834f768 (size=32) on 1 -th hit </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: <core> [mem/q_malloc.c:366]: qm_malloc(0x82bbfa0, 116) called from <core>: parser/msg_parser.c: get_hdr_field(130) </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: <core> [mem/q_malloc.c:406]: qm_malloc(0x82bbfa0, 116) returns address 0x834f7d0 frag. 0x834f7b8 (size=116) on 1 -th hit </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [parser/parse_via.c:2300]: end of header reached, state=2 </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [parser/msg_parser.c:515]: parse_headers: Via found, flags=2 </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 /usr/local/sbin/kamailio[31610]: DEBUG: <core> [parser/msg_parser.c:517]: parse_headers: this is the first via </span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Apr 7 15:30:22 server4967 kamailio: ERROR: <core> [daemonize.c:307]: Main process exited before writing to pipe </span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> </span></b></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> </span></b></p>
<p class="MsoNormal"><span lang="EN-US">My event_rout[] is as fallows:</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">event_route[htable:mod-init]{</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> </span></p><p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">sql_query("cd", "select prefix from lcr_rule", "rc");</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> xlog("L_INFO", "dbr = $dbr(rc=>rows)");</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> if($dbr(rc=>rows)>0){</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> $var(i) = 0;</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> while($var(i)<$dbr(rc=>rows)){</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> </span><span style="font-size:9.0pt;font-family:"Courier New"">$var(prefijo)=$dbr(rc=>[$var(i),0]);</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> </span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">xlog("L_INFO", "$dbr(rc=>[$var(i),0])");</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> sql_query("cd", "ALTER TABLE rebalse ADD COLUMN Prefijo_$var(prefijo) INT","rr");</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> $var(i) = $var(i) + 1;</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> }</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> }</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> sql_result_free("rc");</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">}</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal">
<span lang="EN-US">I tested the commands inside the event_route[] and they work fine…</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Can someone help me?</span></p><p class="MsoNormal">
<span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Regards,</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Camila Troncoso </span></b><b><span style="font-size:10.0pt;font-family:"Trebuchet MS","sans-serif";color:#FFC000">|</span></b><span style="font-size:10.0pt;font-family:"Trebuchet MS","sans-serif";color:gray"> Ingeniero de Desarrollo</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Trebuchet MS","sans-serif";color:black">RedVoiss </span><b><span style="font-size:10.0pt;font-family:"Trebuchet MS","sans-serif";color:#FFC000">|</span></b><span style="font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";color:#7F7F7F"><a href="mailto:ctroncoso@redvoiss.net">ctroncoso@redvoiss.net</a></span><span style="font-size:8.0pt;font-family:"Trebuchet MS","sans-serif";color:black"></span></p>
<p class="MsoNormal" style="margin-top:3.0pt"><span lang="EN-US" style="font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";color:#595959">Santiago</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";color:gray"> - Chile </span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";color:#FFC000">|</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";color:gray"> +56 2 2408535 </span></p>
<p class="MsoNormal" style="margin-top:3.0pt"><span lang="EN-US" style="font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";color:#7F7F7F"><a href="http://www.redvoiss.net">www.redvoiss.net</a> </span><span lang="EN-US" style="font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";color:black"></span></p>
<p class="MsoNormal"> </p></div></body></html>