<div dir="ltr">Is there anything I can do to help with pinpointing the failure ? I have 2 different installations where I can compile kamailio 4.0.2 ( CentOS 6 where app_python fails and Ubuntu 12.10 where app_python works ).<br>
<br>Best regards, <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 14, 2013 at 8:10 AM, Konstantin M. <span dir="ltr"><<a href="mailto:evilzluk@gmail.com" target="_blank">evilzluk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ok, I can confirm, something is not good there. Not sure what exactly but I will look at this as soon as possible and push a fix if needs.<br>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/13 phil lemelin <span dir="ltr"><<a href="mailto:phil.lemelin@gmail.com" target="_blank">phil.lemelin@gmail.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Good day people, <br><br></div>I downloaded the source code for Kamailio on my CentOS 6 server and did the following :<br>


<br>Modified the <a href="http://modules.ls" target="_blank">modules.ls</a> to add db_mysql and app_python.<br>
</div><div>Did the make all<br></div><div>Did the make install<br><br></div><div>Copied the configuration and had the same result. <br><br></div><div>Seeing this, I installed myself a copy of ubuntu 12.10  and modified the <a href="http://modules.ls" target="_blank">modules.ls</a> to add db_mysql and app_python , did the make all and make install. <br>



</div><div>I COPIED the configuration file from my CentOS 6 server and started the application. <br><br></div><div>It works on the ubuntu 12.10.<br><br></div><div>I'm now wondering if there is a dependency missing when using CentOS 6 installation. I did run kamailio with strace but could not see anything obvious.  <br>



</div><div><br></div><div>Any suggestions ?<br></div><div><br></div><div><div><div><div><div><div><div><div><div><div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 10:58 AM, phil lemelin <span dir="ltr"><<a href="mailto:phil.lemelin@gmail.com" target="_blank">phil.lemelin@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">As requested, compressed core dump. <br></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 10:51 AM, Konstantin M. <span dir="ltr"><<a href="mailto:evilzluk@gmail.com" target="_blank">evilzluk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Could you please compress and attach core file.<br></div><div><div><div class="gmail_extra">




<br><br><div class="gmail_quote">2013/6/13 phil lemelin <span dir="ltr"><<a href="mailto:phil.lemelin@gmail.com" target="_blank">phil.lemelin@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Ok, I disabled WITH_MYSQL and left loadmodule "app_python.so" at the end of all the other loadmodule directive and here is the output:<br>






<br>0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br>
 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo<br> 0(3572) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ...<br> 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex<br>







 0(3572) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d8fb-df4-] (0 / 18)<br> 0(3572) ERROR: <core> [mi.c:159]: command <uptime> already registered<br> 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <uptime> for module core<br>







 0(3572) ERROR: <core> [mi.c:159]: command <version> already registered<br> 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <version> for module core<br> 0(3572) ERROR: <core> [mi.c:159]: command <pwd> already registered<br>







 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <pwd> for module core<br> 0(3572) ERROR: <core> [mi.c:159]: command <arg> already registered<br> 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <arg> for module core<br>







 0(3572) ERROR: <core> [mi.c:159]: command <which> already registered<br> 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <which> for module core<br> 0(3572) ERROR: <core> [mi.c:159]: command <kill> already registered<br>







 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <kill> for module core<br> 0(3572) ERROR: <core> [mi.c:159]: command <ps> already registered<br> 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <ps> for module core<br>







 0(3572) ERROR: <core> [mi.c:159]: command <debug> already registered<br> 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <debug> for module core<br> 0(3572) ERROR: <core> [kstats_wrapper.c:73]: counter core.rcv_requests already registered<br>







 0(3572) ERROR: <core> [kstats_wrapper.c:99]: failed to add statistic core.rcv_requests<br> 0(3572) ERROR: kex [core_stats.c:179]: failed to register core statistics<br> 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module kex (/usr/lib64/kamailio/modules/kex.so)<br>







 0(3572) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code:<br>AttributeError: init_modules() has failed<br> 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so)<div>






<br>
ERROR: error while initializing modules<br><br><br></div></div>Now, seeing that key.so module was now failing, which I never saw before, I put the loadmodule for python ABOVE mi_fifo and key and here is the result:<br><br>






</div>
<div>*snip* thousands of line of the same message<br></div><div> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br>







 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br>







 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br>







 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br>







 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br> 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python<br>







Segmentation fault (core dumped)<br><br><br></div><div>Any ideas at this point ?<br><br></div><div>Best regards, <br><br></div><br></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Thu, Jun 13, 2013 at 10:27 AM, Konstantin M. <span dir="ltr"><<a href="mailto:evilzluk@gmail.com" target="_blank">evilzluk@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 dir="ltr"><div><div><div>Yes, you're correct. Default values are:<div><br>modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py"<br>







</div><div>modparam("app_python", "mod_init_function", "mod_init")<br>

modparam("app_python", "child_init_method", "child_init")<br>
<br></div></div>But app_python is nothing related to db_mysql.<br><br></div>Anyways, see my test:<br><br>root@raspberrypi:/opt/kamailio# grep python etc/kamailio/kamailio.cfg<br>loadmodule "app_python.so"<br><br>







root@raspberrypi:/opt/kamailio# cat /usr/local/etc/sip-router/handler.py<div><br>

<br>class Handler(object):<br>    def child_init(self, y):<br>        return 0<br><br>def mod_init():<br>    return Handler()<br><br><br></div>root@raspberrypi:/opt/kamailio# ./start.sh<br>loading modules under /usr/local/lib/kamailio/modules_k/:/opt/kamailio/lib/kamailio/modules/<br>









 0(4536) NOTICE: <core> [sr_module.c:627]: /opt/kamailio/lib/kamailio/modules/app_python.so: exports dlflags interface is deprecated and it will not be supported in newer versions; consider using mod_register() instead<br>









 0(4536) WARNING: <core> [socket_info.c:1407]: WARNING: fix_hostname: could not rev. resolve 0.0.0.0<br>Listening on<br>             udp: <a href="http://0.0.0.0:5062" target="_blank">0.0.0.0:5062</a><br>Aliases:<br>







<br>WARNING: no fork mode<br>

 0(4536) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob<br> 0(4536) INFO: rr [rr_mod.c:159]: outbound module not available<br> 0(4536) INFO: usrloc [hslot.c:53]: locks array size 512<br> 0(4536) INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 163840<br>









 0(4536) INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 327680<br> 4(4540) INFO: ctl [io_listener.c:221]: io_listen_loop: using epoll_lt as the io watch method (auto detected)<br><br><br></div>









So nothing fails there.<br><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/13 phil lemelin <span dir="ltr"><<a href="mailto:phil.lemelin@gmail.com" target="_blank">phil.lemelin@gmail.com</a>></span><br>









<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>If i remove '  loadmodule "app_python.so"   ',  Kamailio starts just fine. This only appears when the app_python module is loaded. <br>









<br></div><div>Is there anything else than mysql to enable when using the app_python ? <br>
</div><div><br></div><div>Here is the ouput when I only enable mysql. The module is loaded and there are no issues...<br><br></div>*snip*<br>^[[0;39;49m 0(3113) DEBUG: <core> [cfg/cfg.c:178]: DEBUG: register_cfg_def(): new config group has been registered: 'core' (num=49, size=196)<br>










^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [cfg/cfg.c:178]: DEBUG: register_cfg_def(): new config group has been registered: 'tcp' (num=26, size=104)<br>^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: init_timer: starting with *ticks=195301735<br>










^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20<br>^[[0;39;49m^[[0;36;49m 0(3113) INFO: <core> [tcp_main.c:4846]: init_tcp: using epoll_lt as the io watch method (auto detected)<br>










^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core dump limits set to 18446744073709551615<br>^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql<br>^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: MySQL client version is 5.1.69<br>










^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo<br>^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ...<br>^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex<br>










^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d186-c29-] (0 / 18)<br>^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: corex<br>^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: tm<br>










^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof cell=4872, sip_msg=1624) initializing...<br>^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID initialization: '2c32dacb59169bda'<br>










</div>*snip*<br></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen <span dir="ltr"><<a href="mailto:admorten@isc.upenn.edu" target="_blank">admorten@isc.upenn.edu</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><br>
On Jun 13, 2013, at 7:23 AM, phil lemelin <<a href="mailto:phil.lemelin@gmail.com" target="_blank">phil.lemelin@gmail.com</a>> wrote:<br>
<br>
> Good morning,<br>
><br>
> I'm trying to use the app_python module with Kamailio but i'm unable to even reach a point where it loads my python module.<br>
<br>
</div>It's actually failing even before that. It's unable to load the db_mysql module:<br>
<div><br>
> 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql<br>
>  0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so)<br>
<br>
</div>Fix that first.<br>
<span><font color="#888888"><br>
andrew<br>
</font></span><div><div><br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>Philippe-Alexandre Lemelin
</font></span></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Philippe-Alexandre Lemelin
</div>
</div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Philippe-Alexandre Lemelin
</div>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>Philippe-Alexandre Lemelin
</font></span></div></div></div></div></div></div></div></div></div></div></div></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a 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><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Philippe-Alexandre Lemelin
</div>