Good morning,
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.
My host:
CentOS release 6.3 (Final) 2.6.32-042stab076.7 x86_64
The installed packages:
[root@host ~]# rpm -qa | grep kamai kamailio-4.0.1-1.1.x86_64 kamailio-mysql-4.0.1-1.1.x86_64 kamailio-python-4.0.1-1.1.x86_64
Configuration modification:
#!define WITH_MYSQL loadmodule "app_python.so"
The python module:
[root@phone ~]# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
When I start Kamailio, it fails like this:
[root@host ~]# kamailio -D 1 -E -e loading modules under /usr/local/lib/kamailio/modules_k/:/usr/lib64/kamailio/modules/ 0(729) NOTICE: <core> [sr_module.c:627]: /usr/lib64/kamailio/modules/app_python.so: exports dlflags interface is deprecated and it will not be supported in newer versions; consider using mod_register() instead Listening on udp: 127.0.0.1:5060 udp: 10.3.105.49:5060 tcp: 127.0.0.1:5060 tcp: 10.3.105.49:5060 Aliases: tcp: phone:5060 tcp: phone.dev.net2.irg:5060 tcp: localhost4:5060 tcp: localhost4.localdomain4:5060 tcp: localhost:5060 tcp: localhost.localdomain:5060 udp: phone:5060 udp: phone.dev.net2.irg:5060 udp: localhost4:5060 udp: localhost4.localdomain4:5060 udp: localhost:5060 udp: localhost.localdomain:5060
WARNING: no fork mode and more than one listen address found (will use only the first one) 0(729) INFO: <core> [tcp_main.c:4846]: init_tcp: using epoll_lt as the io watch method (auto detected) 0(729) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(729) INFO: rr [rr_mod.c:159]: outbound module not available 0(729) INFO: usrloc [hslot.c:53]: locks array size 512 0(729) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) 0(729) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(729) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so) ERROR: error while initializing modules
And with -d -d -d :
*snip* 0(751) DEBUG: <core> [sr_module.c:674]: find_export_record: found <t_release> in module tm [/usr/lib64/kamailio/modules/tm.so] 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) 0(751) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so) ERROR: error while initializing modules 0(751) DEBUG: tm [t_funcs.c:118]: DEBUG: tm_shutdown : start 0(751) DEBUG: tm [t_funcs.c:121]: DEBUG: tm_shutdown : emptying hash table 0(751) DEBUG: tm [t_funcs.c:123]: DEBUG: tm_shutdown : removing semaphores 0(751) DEBUG: tm [t_funcs.c:125]: DEBUG: tm_shutdown : destroying tmcb lists 0(751) DEBUG: tm [t_funcs.c:128]: DEBUG: tm_shutdown : done 0(751) DEBUG: <core> [mem/shm_mem.c:242]: shm_mem_destroy 0(751) DEBUG: <core> [mem/shm_mem.c:245]: destroying the shared memory lock
I've been trying all the configuration permutation I could think off. Am I missing a package or something in the configuration ?
Regards,
Hello, What version of kamailio are you using ?
It is not enough just to add 'loadmodule "app_python.so"'. This module have to be configured properly. For example: modparam("app_python", "script_name", "/path/to/python/file.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
2013/6/13 phil lemelin phil.lemelin@gmail.com
Good morning,
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.
My host:
CentOS release 6.3 (Final) 2.6.32-042stab076.7 x86_64
The installed packages:
[root@host ~]# rpm -qa | grep kamai kamailio-4.0.1-1.1.x86_64 kamailio-mysql-4.0.1-1.1.x86_64 kamailio-python-4.0.1-1.1.x86_64
Configuration modification:
#!define WITH_MYSQL loadmodule "app_python.so"
The python module:
[root@phone ~]# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
When I start Kamailio, it fails like this:
[root@host ~]# kamailio -D 1 -E -e loading modules under /usr/local/lib/kamailio/modules_k/:/usr/lib64/kamailio/modules/ 0(729) NOTICE: <core> [sr_module.c:627]: /usr/lib64/kamailio/modules/app_python.so: exports dlflags interface is deprecated and it will not be supported in newer versions; consider using mod_register() instead Listening on udp: 127.0.0.1:5060 udp: 10.3.105.49:5060 tcp: 127.0.0.1:5060 tcp: 10.3.105.49:5060 Aliases: tcp: phone:5060 tcp: phone.dev.net2.irg:5060 tcp: localhost4:5060 tcp: localhost4.localdomain4:5060 tcp: localhost:5060 tcp: localhost.localdomain:5060 udp: phone:5060 udp: phone.dev.net2.irg:5060 udp: localhost4:5060 udp: localhost4.localdomain4:5060 udp: localhost:5060 udp: localhost.localdomain:5060
WARNING: no fork mode and more than one listen address found (will use only the first one) 0(729) INFO: <core> [tcp_main.c:4846]: init_tcp: using epoll_lt as the io watch method (auto detected) 0(729) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(729) INFO: rr [rr_mod.c:159]: outbound module not available 0(729) INFO: usrloc [hslot.c:53]: locks array size 512 0(729) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) 0(729) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(729) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so) ERROR: error while initializing modules
And with -d -d -d :
*snip* 0(751) DEBUG: <core> [sr_module.c:674]: find_export_record: found <t_release> in module tm [/usr/lib64/kamailio/modules/tm.so] 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) 0(751) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so) ERROR: error while initializing modules 0(751) DEBUG: tm [t_funcs.c:118]: DEBUG: tm_shutdown : start 0(751) DEBUG: tm [t_funcs.c:121]: DEBUG: tm_shutdown : emptying hash table 0(751) DEBUG: tm [t_funcs.c:123]: DEBUG: tm_shutdown : removing semaphores 0(751) DEBUG: tm [t_funcs.c:125]: DEBUG: tm_shutdown : destroying tmcb lists 0(751) DEBUG: tm [t_funcs.c:128]: DEBUG: tm_shutdown : done 0(751) DEBUG: <core> [mem/shm_mem.c:242]: shm_mem_destroy 0(751) DEBUG: <core> [mem/shm_mem.c:245]: destroying the shared memory lock
I've been trying all the configuration permutation I could think off. Am I missing a package or something in the configuration ?
Regards,
-- Phil.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
As describe in my original post:
The installed packages:
[root@host ~]# rpm -qa | grep kamai kamailio-4.0.1-1.1.x86_64 kamailio-mysql-4.0.1-1.1.x86_ 64 kamailio-python-4.0.1-1.1.x86_64
So, Kamailio 4.0.1-1.1
My understanding is that the default values are the following: modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py") modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
But just to make sure, I added the following line in my kamailio.cfg, and again:
[root@host ~]# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
When I start kamailio, I have the same error. I also downloaded the sources and compiled kamailio with app_python support and I have the exact same result
0(2158) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(2158) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(2158) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) 0(2158) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(2158) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so) ERROR: error while initializing modules
Is this a bug with Kamailio ?
On Thu, Jun 13, 2013 at 8:39 AM, Konstantin M. evilzluk@gmail.com wrote:
Hello, What version of kamailio are you using ?
It is not enough just to add 'loadmodule "app_python.so"'. This module have to be configured properly. For example: modparam("app_python", "script_name", "/path/to/python/file.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
2013/6/13 phil lemelin phil.lemelin@gmail.com
Good morning,
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.
My host:
CentOS release 6.3 (Final) 2.6.32-042stab076.7 x86_64
The installed packages:
[root@host ~]# rpm -qa | grep kamai kamailio-4.0.1-1.1.x86_64 kamailio-mysql-4.0.1-1.1.x86_64 kamailio-python-4.0.1-1.1.x86_64
Configuration modification:
#!define WITH_MYSQL loadmodule "app_python.so"
The python module:
[root@phone ~]# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
When I start Kamailio, it fails like this:
[root@host ~]# kamailio -D 1 -E -e loading modules under /usr/local/lib/kamailio/modules_k/:/usr/lib64/kamailio/modules/ 0(729) NOTICE: <core> [sr_module.c:627]: /usr/lib64/kamailio/modules/app_python.so: exports dlflags interface is deprecated and it will not be supported in newer versions; consider using mod_register() instead Listening on udp: 127.0.0.1:5060 udp: 10.3.105.49:5060 tcp: 127.0.0.1:5060 tcp: 10.3.105.49:5060 Aliases: tcp: phone:5060 tcp: phone.dev.net2.irg:5060 tcp: localhost4:5060 tcp: localhost4.localdomain4:5060 tcp: localhost:5060 tcp: localhost.localdomain:5060 udp: phone:5060 udp: phone.dev.net2.irg:5060 udp: localhost4:5060 udp: localhost4.localdomain4:5060 udp: localhost:5060 udp: localhost.localdomain:5060
WARNING: no fork mode and more than one listen address found (will use only the first one) 0(729) INFO: <core> [tcp_main.c:4846]: init_tcp: using epoll_lt as the io watch method (auto detected) 0(729) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(729) INFO: rr [rr_mod.c:159]: outbound module not available 0(729) INFO: usrloc [hslot.c:53]: locks array size 512 0(729) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) 0(729) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(729) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so) ERROR: error while initializing modules
And with -d -d -d :
*snip* 0(751) DEBUG: <core> [sr_module.c:674]: find_export_record: found <t_release> in module tm [/usr/lib64/kamailio/modules/tm.so] 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) 0(751) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so) ERROR: error while initializing modules 0(751) DEBUG: tm [t_funcs.c:118]: DEBUG: tm_shutdown : start 0(751) DEBUG: tm [t_funcs.c:121]: DEBUG: tm_shutdown : emptying hash table 0(751) DEBUG: tm [t_funcs.c:123]: DEBUG: tm_shutdown : removing semaphores 0(751) DEBUG: tm [t_funcs.c:125]: DEBUG: tm_shutdown : destroying tmcb lists 0(751) DEBUG: tm [t_funcs.c:128]: DEBUG: tm_shutdown : done 0(751) DEBUG: <core> [mem/shm_mem.c:242]: shm_mem_destroy 0(751) DEBUG: <core> [mem/shm_mem.c:245]: destroying the shared memory lock
I've been trying all the configuration permutation I could think off. Am I missing a package or something in the configuration ?
Regards,
-- Phil.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com wrote:
Good morning,
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.
It's actually failing even before that. It's unable to load the db_mysql module:
0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so)
Fix that first.
andrew
If i remove ' loadmodule "app_python.so" ', Kamailio starts just fine. This only appears when the app_python module is loaded.
Is there anything else than mysql to enable when using the app_python ?
Here is the ouput when I only enable mysql. The module is loaded and there are no issues...
*snip* ^[[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) ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: init_timer: starting with *ticks=195301735 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20 ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core dump limits set to 18446744073709551615 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: MySQL client version is 5.1.69 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d186-c29-] (0 / 18) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: corex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: tm ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof cell=4872, sip_msg=1624) initializing... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID initialization: '2c32dacb59169bda' *snip*
On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen admorten@isc.upenn.eduwrote:
On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com wrote:
Good morning,
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.
It's actually failing even before that. It's unable to load the db_mysql module:
0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while
initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so)
Fix that first.
andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Yes, you're correct. Default values are: modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
But app_python is nothing related to db_mysql.
Anyways, see my test:
root@raspberrypi:/opt/kamailio# grep python etc/kamailio/kamailio.cfg loadmodule "app_python.so"
root@raspberrypi:/opt/kamailio# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
root@raspberrypi:/opt/kamailio# ./start.sh loading modules under /usr/local/lib/kamailio/modules_k/:/opt/kamailio/lib/kamailio/modules/ 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 0(4536) WARNING: <core> [socket_info.c:1407]: WARNING: fix_hostname: could not rev. resolve 0.0.0.0 Listening on udp: 0.0.0.0:5062 Aliases:
WARNING: no fork mode 0(4536) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(4536) INFO: rr [rr_mod.c:159]: outbound module not available 0(4536) INFO: usrloc [hslot.c:53]: locks array size 512 0(4536) INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 163840 0(4536) INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 327680 4(4540) INFO: ctl [io_listener.c:221]: io_listen_loop: using epoll_lt as the io watch method (auto detected)
So nothing fails there.
2013/6/13 phil lemelin phil.lemelin@gmail.com
If i remove ' loadmodule "app_python.so" ', Kamailio starts just fine. This only appears when the app_python module is loaded.
Is there anything else than mysql to enable when using the app_python ?
Here is the ouput when I only enable mysql. The module is loaded and there are no issues...
*snip* ^[[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) ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: init_timer: starting with *ticks=195301735 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20 ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core dump limits set to 18446744073709551615 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: MySQL client version is 5.1.69 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d186-c29-] (0 / 18) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: corex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: tm ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof cell=4872, sip_msg=1624) initializing... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID initialization: '2c32dacb59169bda' *snip*
On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen admorten@isc.upenn.eduwrote:
On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com wrote:
Good morning,
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.
It's actually failing even before that. It's unable to load the db_mysql module:
0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while
initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so)
Fix that first.
andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
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:
0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo 0(3572) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex 0(3572) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d8fb-df4-] (0 / 18) 0(3572) ERROR: <core> [mi.c:159]: command <uptime> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <uptime> for module core 0(3572) ERROR: <core> [mi.c:159]: command <version> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <version> for module core 0(3572) ERROR: <core> [mi.c:159]: command <pwd> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <pwd> for module core 0(3572) ERROR: <core> [mi.c:159]: command <arg> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <arg> for module core 0(3572) ERROR: <core> [mi.c:159]: command <which> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <which> for module core 0(3572) ERROR: <core> [mi.c:159]: command <kill> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <kill> for module core 0(3572) ERROR: <core> [mi.c:159]: command <ps> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <ps> for module core 0(3572) ERROR: <core> [mi.c:159]: command <debug> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <debug> for module core 0(3572) ERROR: <core> [kstats_wrapper.c:73]: counter core.rcv_requests already registered 0(3572) ERROR: <core> [kstats_wrapper.c:99]: failed to add statistic core.rcv_requests 0(3572) ERROR: kex [core_stats.c:179]: failed to register core statistics 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module kex (/usr/lib64/kamailio/modules/kex.so) 0(3572) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so) ERROR: error while initializing modules
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:
*snip* thousands of line of the same message 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python Segmentation fault (core dumped)
Any ideas at this point ?
Best regards,
On Thu, Jun 13, 2013 at 10:27 AM, Konstantin M. evilzluk@gmail.com wrote:
Yes, you're correct. Default values are:
modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
But app_python is nothing related to db_mysql.
Anyways, see my test:
root@raspberrypi:/opt/kamailio# grep python etc/kamailio/kamailio.cfg loadmodule "app_python.so"
root@raspberrypi:/opt/kamailio# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
root@raspberrypi:/opt/kamailio# ./start.sh loading modules under /usr/local/lib/kamailio/modules_k/:/opt/kamailio/lib/kamailio/modules/ 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 0(4536) WARNING: <core> [socket_info.c:1407]: WARNING: fix_hostname: could not rev. resolve 0.0.0.0 Listening on udp: 0.0.0.0:5062 Aliases:
WARNING: no fork mode 0(4536) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(4536) INFO: rr [rr_mod.c:159]: outbound module not available 0(4536) INFO: usrloc [hslot.c:53]: locks array size 512 0(4536) INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 163840 0(4536) INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 327680 4(4540) INFO: ctl [io_listener.c:221]: io_listen_loop: using epoll_lt as the io watch method (auto detected)
So nothing fails there.
2013/6/13 phil lemelin phil.lemelin@gmail.com
If i remove ' loadmodule "app_python.so" ', Kamailio starts just fine. This only appears when the app_python module is loaded.
Is there anything else than mysql to enable when using the app_python ?
Here is the ouput when I only enable mysql. The module is loaded and there are no issues...
*snip* ^[[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) ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: init_timer: starting with *ticks=195301735 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20 ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core dump limits set to 18446744073709551615 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: MySQL client version is 5.1.69 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d186-c29-] (0 / 18) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: corex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: tm ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof cell=4872, sip_msg=1624) initializing... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID initialization: '2c32dacb59169bda' *snip*
On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen <admorten@isc.upenn.edu
wrote:
On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com wrote:
Good morning,
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.
It's actually failing even before that. It's unable to load the db_mysql module:
0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while
initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so)
Fix that first.
andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Could you please compress and attach core file.
2013/6/13 phil lemelin phil.lemelin@gmail.com
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:
0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo 0(3572) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex 0(3572) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d8fb-df4-] (0 / 18) 0(3572) ERROR: <core> [mi.c:159]: command <uptime> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <uptime> for module core 0(3572) ERROR: <core> [mi.c:159]: command <version> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <version> for module core 0(3572) ERROR: <core> [mi.c:159]: command <pwd> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <pwd> for module core 0(3572) ERROR: <core> [mi.c:159]: command <arg> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <arg> for module core 0(3572) ERROR: <core> [mi.c:159]: command <which> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <which> for module core 0(3572) ERROR: <core> [mi.c:159]: command <kill> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <kill> for module core 0(3572) ERROR: <core> [mi.c:159]: command <ps> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <ps> for module core 0(3572) ERROR: <core> [mi.c:159]: command <debug> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <debug> for module core 0(3572) ERROR: <core> [kstats_wrapper.c:73]: counter core.rcv_requests already registered 0(3572) ERROR: <core> [kstats_wrapper.c:99]: failed to add statistic core.rcv_requests 0(3572) ERROR: kex [core_stats.c:179]: failed to register core statistics 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module kex (/usr/lib64/kamailio/modules/kex.so) 0(3572) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so)
ERROR: error while initializing modules
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:
*snip* thousands of line of the same message 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python Segmentation fault (core dumped)
Any ideas at this point ?
Best regards,
On Thu, Jun 13, 2013 at 10:27 AM, Konstantin M. evilzluk@gmail.comwrote:
Yes, you're correct. Default values are:
modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
But app_python is nothing related to db_mysql.
Anyways, see my test:
root@raspberrypi:/opt/kamailio# grep python etc/kamailio/kamailio.cfg loadmodule "app_python.so"
root@raspberrypi:/opt/kamailio# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
root@raspberrypi:/opt/kamailio# ./start.sh loading modules under /usr/local/lib/kamailio/modules_k/:/opt/kamailio/lib/kamailio/modules/ 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 0(4536) WARNING: <core> [socket_info.c:1407]: WARNING: fix_hostname: could not rev. resolve 0.0.0.0 Listening on udp: 0.0.0.0:5062 Aliases:
WARNING: no fork mode 0(4536) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(4536) INFO: rr [rr_mod.c:159]: outbound module not available 0(4536) INFO: usrloc [hslot.c:53]: locks array size 512 0(4536) INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 163840 0(4536) INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 327680 4(4540) INFO: ctl [io_listener.c:221]: io_listen_loop: using epoll_lt as the io watch method (auto detected)
So nothing fails there.
2013/6/13 phil lemelin phil.lemelin@gmail.com
If i remove ' loadmodule "app_python.so" ', Kamailio starts just fine. This only appears when the app_python module is loaded.
Is there anything else than mysql to enable when using the app_python ?
Here is the ouput when I only enable mysql. The module is loaded and there are no issues...
*snip* ^[[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) ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: init_timer: starting with *ticks=195301735 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20 ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core dump limits set to 18446744073709551615 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: MySQL client version is 5.1.69 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d186-c29-] (0 / 18) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: corex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: tm ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof cell=4872, sip_msg=1624) initializing... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID initialization: '2c32dacb59169bda' *snip*
On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen < admorten@isc.upenn.edu> wrote:
On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com wrote:
Good morning,
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.
It's actually failing even before that. It's unable to load the db_mysql module:
0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while
initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so)
Fix that first.
andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
As requested, compressed core dump.
On Thu, Jun 13, 2013 at 10:51 AM, Konstantin M. evilzluk@gmail.com wrote:
Could you please compress and attach core file.
2013/6/13 phil lemelin phil.lemelin@gmail.com
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:
0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo 0(3572) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex 0(3572) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d8fb-df4-] (0 / 18) 0(3572) ERROR: <core> [mi.c:159]: command <uptime> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <uptime> for module core 0(3572) ERROR: <core> [mi.c:159]: command <version> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <version> for module core 0(3572) ERROR: <core> [mi.c:159]: command <pwd> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <pwd> for module core 0(3572) ERROR: <core> [mi.c:159]: command <arg> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <arg> for module core 0(3572) ERROR: <core> [mi.c:159]: command <which> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <which> for module core 0(3572) ERROR: <core> [mi.c:159]: command <kill> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <kill> for module core 0(3572) ERROR: <core> [mi.c:159]: command <ps> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <ps> for module core 0(3572) ERROR: <core> [mi.c:159]: command <debug> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <debug> for module core 0(3572) ERROR: <core> [kstats_wrapper.c:73]: counter core.rcv_requests already registered 0(3572) ERROR: <core> [kstats_wrapper.c:99]: failed to add statistic core.rcv_requests 0(3572) ERROR: kex [core_stats.c:179]: failed to register core statistics 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module kex (/usr/lib64/kamailio/modules/kex.so) 0(3572) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so)
ERROR: error while initializing modules
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:
*snip* thousands of line of the same message 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python Segmentation fault (core dumped)
Any ideas at this point ?
Best regards,
On Thu, Jun 13, 2013 at 10:27 AM, Konstantin M. evilzluk@gmail.comwrote:
Yes, you're correct. Default values are:
modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
But app_python is nothing related to db_mysql.
Anyways, see my test:
root@raspberrypi:/opt/kamailio# grep python etc/kamailio/kamailio.cfg loadmodule "app_python.so"
root@raspberrypi:/opt/kamailio# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
root@raspberrypi:/opt/kamailio# ./start.sh loading modules under /usr/local/lib/kamailio/modules_k/:/opt/kamailio/lib/kamailio/modules/ 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 0(4536) WARNING: <core> [socket_info.c:1407]: WARNING: fix_hostname: could not rev. resolve 0.0.0.0 Listening on udp: 0.0.0.0:5062 Aliases:
WARNING: no fork mode 0(4536) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(4536) INFO: rr [rr_mod.c:159]: outbound module not available 0(4536) INFO: usrloc [hslot.c:53]: locks array size 512 0(4536) INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 163840 0(4536) INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 327680 4(4540) INFO: ctl [io_listener.c:221]: io_listen_loop: using epoll_lt as the io watch method (auto detected)
So nothing fails there.
2013/6/13 phil lemelin phil.lemelin@gmail.com
If i remove ' loadmodule "app_python.so" ', Kamailio starts just fine. This only appears when the app_python module is loaded.
Is there anything else than mysql to enable when using the app_python ?
Here is the ouput when I only enable mysql. The module is loaded and there are no issues...
*snip* ^[[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) ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: init_timer: starting with *ticks=195301735 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20 ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core dump limits set to 18446744073709551615 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: MySQL client version is 5.1.69 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d186-c29-] (0 / 18) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: corex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: tm ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof cell=4872, sip_msg=1624) initializing... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID initialization: '2c32dacb59169bda' *snip*
On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen < admorten@isc.upenn.edu> wrote:
On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com wrote:
Good morning,
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.
It's actually failing even before that. It's unable to load the db_mysql module:
0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while
initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so)
Fix that first.
andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Good day people,
I downloaded the source code for Kamailio on my CentOS 6 server and did the following :
Modified the modules.ls to add db_mysql and app_python. Did the make all Did the make install
Copied the configuration and had the same result.
Seeing this, I installed myself a copy of ubuntu 12.10 and modified the modules.ls to add db_mysql and app_python , did the make all and make install. I COPIED the configuration file from my CentOS 6 server and started the application.
It works on the ubuntu 12.10.
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.
Any suggestions ?
On Thu, Jun 13, 2013 at 10:58 AM, phil lemelin phil.lemelin@gmail.comwrote:
As requested, compressed core dump.
On Thu, Jun 13, 2013 at 10:51 AM, Konstantin M. evilzluk@gmail.comwrote:
Could you please compress and attach core file.
2013/6/13 phil lemelin phil.lemelin@gmail.com
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:
0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo 0(3572) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex 0(3572) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d8fb-df4-] (0 / 18) 0(3572) ERROR: <core> [mi.c:159]: command <uptime> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <uptime> for module core 0(3572) ERROR: <core> [mi.c:159]: command <version> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <version> for module core 0(3572) ERROR: <core> [mi.c:159]: command <pwd> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <pwd> for module core 0(3572) ERROR: <core> [mi.c:159]: command <arg> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <arg> for module core 0(3572) ERROR: <core> [mi.c:159]: command <which> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <which> for module core 0(3572) ERROR: <core> [mi.c:159]: command <kill> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <kill> for module core 0(3572) ERROR: <core> [mi.c:159]: command <ps> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <ps> for module core 0(3572) ERROR: <core> [mi.c:159]: command <debug> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <debug> for module core 0(3572) ERROR: <core> [kstats_wrapper.c:73]: counter core.rcv_requests already registered 0(3572) ERROR: <core> [kstats_wrapper.c:99]: failed to add statistic core.rcv_requests 0(3572) ERROR: kex [core_stats.c:179]: failed to register core statistics 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module kex (/usr/lib64/kamailio/modules/kex.so) 0(3572) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so)
ERROR: error while initializing modules
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:
*snip* thousands of line of the same message 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python Segmentation fault (core dumped)
Any ideas at this point ?
Best regards,
On Thu, Jun 13, 2013 at 10:27 AM, Konstantin M. evilzluk@gmail.comwrote:
Yes, you're correct. Default values are:
modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
But app_python is nothing related to db_mysql.
Anyways, see my test:
root@raspberrypi:/opt/kamailio# grep python etc/kamailio/kamailio.cfg loadmodule "app_python.so"
root@raspberrypi:/opt/kamailio# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
root@raspberrypi:/opt/kamailio# ./start.sh loading modules under /usr/local/lib/kamailio/modules_k/:/opt/kamailio/lib/kamailio/modules/ 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 0(4536) WARNING: <core> [socket_info.c:1407]: WARNING: fix_hostname: could not rev. resolve 0.0.0.0 Listening on udp: 0.0.0.0:5062 Aliases:
WARNING: no fork mode 0(4536) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(4536) INFO: rr [rr_mod.c:159]: outbound module not available 0(4536) INFO: usrloc [hslot.c:53]: locks array size 512 0(4536) INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 163840 0(4536) INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 327680 4(4540) INFO: ctl [io_listener.c:221]: io_listen_loop: using epoll_lt as the io watch method (auto detected)
So nothing fails there.
2013/6/13 phil lemelin phil.lemelin@gmail.com
If i remove ' loadmodule "app_python.so" ', Kamailio starts just fine. This only appears when the app_python module is loaded.
Is there anything else than mysql to enable when using the app_python ?
Here is the ouput when I only enable mysql. The module is loaded and there are no issues...
*snip* ^[[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) ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: init_timer: starting with *ticks=195301735 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20 ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core dump limits set to 18446744073709551615 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: MySQL client version is 5.1.69 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d186-c29-] (0 / 18) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: corex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: tm ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof cell=4872, sip_msg=1624) initializing... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID initialization: '2c32dacb59169bda' *snip*
On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen < admorten@isc.upenn.edu> wrote:
On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com wrote:
> Good morning, > > 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.
It's actually failing even before that. It's unable to load the db_mysql module:
> 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql > 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so)
Fix that first.
andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
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.
2013/6/13 phil lemelin phil.lemelin@gmail.com
Good day people,
I downloaded the source code for Kamailio on my CentOS 6 server and did the following :
Modified the modules.ls to add db_mysql and app_python. Did the make all Did the make install
Copied the configuration and had the same result.
Seeing this, I installed myself a copy of ubuntu 12.10 and modified the modules.ls to add db_mysql and app_python , did the make all and make install. I COPIED the configuration file from my CentOS 6 server and started the application.
It works on the ubuntu 12.10.
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.
Any suggestions ?
On Thu, Jun 13, 2013 at 10:58 AM, phil lemelin phil.lemelin@gmail.comwrote:
As requested, compressed core dump.
On Thu, Jun 13, 2013 at 10:51 AM, Konstantin M. evilzluk@gmail.comwrote:
Could you please compress and attach core file.
2013/6/13 phil lemelin phil.lemelin@gmail.com
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:
0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo 0(3572) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex 0(3572) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d8fb-df4-] (0 / 18) 0(3572) ERROR: <core> [mi.c:159]: command <uptime> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <uptime> for module core 0(3572) ERROR: <core> [mi.c:159]: command <version> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <version> for module core 0(3572) ERROR: <core> [mi.c:159]: command <pwd> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <pwd> for module core 0(3572) ERROR: <core> [mi.c:159]: command <arg> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <arg> for module core 0(3572) ERROR: <core> [mi.c:159]: command <which> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <which> for module core 0(3572) ERROR: <core> [mi.c:159]: command <kill> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <kill> for module core 0(3572) ERROR: <core> [mi.c:159]: command <ps> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <ps> for module core 0(3572) ERROR: <core> [mi.c:159]: command <debug> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <debug> for module core 0(3572) ERROR: <core> [kstats_wrapper.c:73]: counter core.rcv_requests already registered 0(3572) ERROR: <core> [kstats_wrapper.c:99]: failed to add statistic core.rcv_requests 0(3572) ERROR: kex [core_stats.c:179]: failed to register core statistics 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module kex (/usr/lib64/kamailio/modules/kex.so) 0(3572) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so)
ERROR: error while initializing modules
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:
*snip* thousands of line of the same message 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python Segmentation fault (core dumped)
Any ideas at this point ?
Best regards,
On Thu, Jun 13, 2013 at 10:27 AM, Konstantin M. evilzluk@gmail.comwrote:
Yes, you're correct. Default values are:
modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
But app_python is nothing related to db_mysql.
Anyways, see my test:
root@raspberrypi:/opt/kamailio# grep python etc/kamailio/kamailio.cfg loadmodule "app_python.so"
root@raspberrypi:/opt/kamailio# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
root@raspberrypi:/opt/kamailio# ./start.sh loading modules under /usr/local/lib/kamailio/modules_k/:/opt/kamailio/lib/kamailio/modules/ 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 0(4536) WARNING: <core> [socket_info.c:1407]: WARNING: fix_hostname: could not rev. resolve 0.0.0.0 Listening on udp: 0.0.0.0:5062 Aliases:
WARNING: no fork mode 0(4536) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(4536) INFO: rr [rr_mod.c:159]: outbound module not available 0(4536) INFO: usrloc [hslot.c:53]: locks array size 512 0(4536) INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 163840 0(4536) INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 327680 4(4540) INFO: ctl [io_listener.c:221]: io_listen_loop: using epoll_lt as the io watch method (auto detected)
So nothing fails there.
2013/6/13 phil lemelin phil.lemelin@gmail.com
If i remove ' loadmodule "app_python.so" ', Kamailio starts just fine. This only appears when the app_python module is loaded.
Is there anything else than mysql to enable when using the app_python ?
Here is the ouput when I only enable mysql. The module is loaded and there are no issues...
*snip* ^[[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) ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: init_timer: starting with *ticks=195301735 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20 ^[[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) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core dump limits set to 18446744073709551615 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: MySQL client version is 5.1.69 ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d186-c29-] (0 / 18) ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: corex ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: tm ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof cell=4872, sip_msg=1624) initializing... ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID initialization: '2c32dacb59169bda' *snip*
On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen < admorten@isc.upenn.edu> wrote:
> > On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com > wrote: > > > Good morning, > > > > 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. > > It's actually failing even before that. It's unable to load the > db_mysql module: > > > 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql > > 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while > initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) > > Fix that first. > > andrew > > > _______________________________________________ > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing > list > sr-users@lists.sip-router.org > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users >
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
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 ).
Best regards,
On Fri, Jun 14, 2013 at 8:10 AM, Konstantin M. evilzluk@gmail.com wrote:
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.
2013/6/13 phil lemelin phil.lemelin@gmail.com
Good day people,
I downloaded the source code for Kamailio on my CentOS 6 server and did the following :
Modified the modules.ls to add db_mysql and app_python. Did the make all Did the make install
Copied the configuration and had the same result.
Seeing this, I installed myself a copy of ubuntu 12.10 and modified the modules.ls to add db_mysql and app_python , did the make all and make install. I COPIED the configuration file from my CentOS 6 server and started the application.
It works on the ubuntu 12.10.
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.
Any suggestions ?
On Thu, Jun 13, 2013 at 10:58 AM, phil lemelin phil.lemelin@gmail.comwrote:
As requested, compressed core dump.
On Thu, Jun 13, 2013 at 10:51 AM, Konstantin M. evilzluk@gmail.comwrote:
Could you please compress and attach core file.
2013/6/13 phil lemelin phil.lemelin@gmail.com
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:
0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: mi_fifo 0(3572) DEBUG: mi_fifo [mi_fifo.c:124]: testing mi_fifo existance ... 0(3572) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: kex 0(3572) DEBUG: <core> [sruid.c:100]: root for sruid is [srid-51b9d8fb-df4-] (0 / 18) 0(3572) ERROR: <core> [mi.c:159]: command <uptime> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <uptime> for module core 0(3572) ERROR: <core> [mi.c:159]: command <version> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <version> for module core 0(3572) ERROR: <core> [mi.c:159]: command <pwd> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <pwd> for module core 0(3572) ERROR: <core> [mi.c:159]: command <arg> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <arg> for module core 0(3572) ERROR: <core> [mi.c:159]: command <which> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <which> for module core 0(3572) ERROR: <core> [mi.c:159]: command <kill> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <kill> for module core 0(3572) ERROR: <core> [mi.c:159]: command <ps> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <ps> for module core 0(3572) ERROR: <core> [mi.c:159]: command <debug> already registered 0(3572) ERROR: <core> [mi.c:94]: failed to register cmd <debug> for module core 0(3572) ERROR: <core> [kstats_wrapper.c:73]: counter core.rcv_requests already registered 0(3572) ERROR: <core> [kstats_wrapper.c:99]: failed to add statistic core.rcv_requests 0(3572) ERROR: kex [core_stats.c:179]: failed to register core statistics 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module kex (/usr/lib64/kamailio/modules/kex.so) 0(3572) ERROR: app_python [python_support.c:132]: mod_init: Unhandled exception in the Python code: AttributeError: init_modules() has failed 0(3572) ERROR: <core> [sr_module.c:939]: init_mod(): Error while initializing module app_python (/usr/lib64/kamailio/modules/app_python.so)
ERROR: error while initializing modules
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:
*snip* thousands of line of the same message 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python 0(3595) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: app_python Segmentation fault (core dumped)
Any ideas at this point ?
Best regards,
On Thu, Jun 13, 2013 at 10:27 AM, Konstantin M. evilzluk@gmail.comwrote:
Yes, you're correct. Default values are:
modparam("app_python", "script_name", "/usr/local/etc/sip-router/handler.py" modparam("app_python", "mod_init_function", "mod_init") modparam("app_python", "child_init_method", "child_init")
But app_python is nothing related to db_mysql.
Anyways, see my test:
root@raspberrypi:/opt/kamailio# grep python etc/kamailio/kamailio.cfg loadmodule "app_python.so"
root@raspberrypi:/opt/kamailio# cat /usr/local/etc/sip-router/handler.py
class Handler(object): def child_init(self, y): return 0
def mod_init(): return Handler()
root@raspberrypi:/opt/kamailio# ./start.sh loading modules under /usr/local/lib/kamailio/modules_k/:/opt/kamailio/lib/kamailio/modules/ 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 0(4536) WARNING: <core> [socket_info.c:1407]: WARNING: fix_hostname: could not rev. resolve 0.0.0.0 Listening on udp: 0.0.0.0:5062 Aliases:
WARNING: no fork mode 0(4536) INFO: rr [../outbound/api.h:49]: Failed to import bind_ob 0(4536) INFO: rr [rr_mod.c:159]: outbound module not available 0(4536) INFO: usrloc [hslot.c:53]: locks array size 512 0(4536) INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 163840 0(4536) INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 327680 4(4540) INFO: ctl [io_listener.c:221]: io_listen_loop: using epoll_lt as the io watch method (auto detected)
So nothing fails there.
2013/6/13 phil lemelin phil.lemelin@gmail.com
> If i remove ' loadmodule "app_python.so" ', Kamailio starts just > fine. This only appears when the app_python module is loaded. > > Is there anything else than mysql to enable when using the > app_python ? > > Here is the ouput when I only enable mysql. The module is loaded and > there are no issues... > > *snip* > ^[[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) > ^[[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) > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:272]: > init_timer: starting with *ticks=195301735 > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [timer.c:314]: > init_timer: timer_list between 0x7fa54af1ba20 and 0x7fa54af5fa20 > ^[[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) > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [daemonize.c:575]: core > dump limits set to 18446744073709551615 > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: > DEBUG: init_mod: db_mysql > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: db_mysql [km_db_mysql.c:92]: > MySQL client version is 5.1.69 > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: > DEBUG: init_mod: mi_fifo > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: mi_fifo [mi_fifo.c:124]: > testing mi_fifo existance ... > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: > DEBUG: init_mod: kex > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sruid.c:100]: root for > sruid is [srid-51b9d186-c29-] (0 / 18) > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: > DEBUG: init_mod: corex > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: <core> [sr_module.c:935]: > DEBUG: init_mod: tm > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [tm.c:751]: TM - (sizeof > cell=4872, sip_msg=1624) initializing... > ^[[0;39;49m^[[0;39;49m 0(3113) DEBUG: tm [callid.c:105]: Call-ID > initialization: '2c32dacb59169bda' > *snip* > > > On Thu, Jun 13, 2013 at 9:48 AM, Andrew Mortensen < > admorten@isc.upenn.edu> wrote: > >> >> On Jun 13, 2013, at 7:23 AM, phil lemelin phil.lemelin@gmail.com >> wrote: >> >> > Good morning, >> > >> > 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. >> >> It's actually failing even before that. It's unable to load the >> db_mysql module: >> >> > 0(751) DEBUG: <core> [sr_module.c:935]: DEBUG: init_mod: db_mysql >> > 0(751) ERROR: <core> [sr_module.c:939]: init_mod(): Error while >> initializing module db_mysql (/usr/lib64/kamailio/modules/db_mysql.so) >> >> Fix that first. >> >> andrew >> >> >> _______________________________________________ >> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing >> list >> sr-users@lists.sip-router.org >> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users >> > > > > -- > Philippe-Alexandre Lemelin > > _______________________________________________ > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing > list > sr-users@lists.sip-router.org > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users > >
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Philippe-Alexandre Lemelin
-- Philippe-Alexandre Lemelin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users