Hi,
I think the EVAPI listening socket should be bound with setsockopt SO_REUSEADDR.
Often, when I restart Kamailio, I cannot immediately get it to stop because the listening descriptor was seemingly not shutdown()'d/close()'d cleanly:
Jan 18 13:14:09 sip-xmpp kamailio[24771]: ERROR: evapi [evapi_dispatch.c:474]: evapi_run_dispatcher(): cannot bind to local address and port [0.0.0.0:8010] Jan 18 13:14:09 sip-xmpp kamailio[24771]: ERROR: evapi [evapi_mod.c:181]: child_init(): failed to initialize disptacher process Jan 18 13:14:09 sip-xmpp kamailio[24771]: ERROR: <core> [sr_module.c:923]: init_mod_child(): Error while initializing module evapi (/usr/local/lib64/kamailio/modules/evapi.so) Jan 18 13:14:09 sip-xmpp kamailio[24771]: ERROR: <core> [main.c:1707]: main_loop(): error in init_child Jan 18 13:14:09 sip-xmpp kamailio[24752]: ALERT: <core> [main.c:781]: handle_sigs(): child process 24771 exited normally, status=255 Jan 18 13:14:09 sip-xmpp kamailio[24752]: INFO: <core> [main.c:799]: handle_sigs(): terminating due to SIGCHLD
... but there is nothing listening:
[root@peacock kamailio]# telnet localhost 8010 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused
The SO_REUSEADDR option would solve that problem I think.
-- Alex
Hello,
you can make a patch and if works as you expect, push it to the master. We can review then and consider it for backporting.
Cheers, Daniel
On 18/01/15 22:20, Alex Balashov wrote:
Hi,
I think the EVAPI listening socket should be bound with setsockopt SO_REUSEADDR.
Often, when I restart Kamailio, I cannot immediately get it to stop because the listening descriptor was seemingly not shutdown()'d/close()'d cleanly:
Jan 18 13:14:09 sip-xmpp kamailio[24771]: ERROR: evapi [evapi_dispatch.c:474]: evapi_run_dispatcher(): cannot bind to local address and port [0.0.0.0:8010] Jan 18 13:14:09 sip-xmpp kamailio[24771]: ERROR: evapi [evapi_mod.c:181]: child_init(): failed to initialize disptacher process Jan 18 13:14:09 sip-xmpp kamailio[24771]: ERROR: <core> [sr_module.c:923]: init_mod_child(): Error while initializing module evapi (/usr/local/lib64/kamailio/modules/evapi.so) Jan 18 13:14:09 sip-xmpp kamailio[24771]: ERROR: <core> [main.c:1707]: main_loop(): error in init_child Jan 18 13:14:09 sip-xmpp kamailio[24752]: ALERT: <core> [main.c:781]: handle_sigs(): child process 24771 exited normally, status=255 Jan 18 13:14:09 sip-xmpp kamailio[24752]: INFO: <core> [main.c:799]: handle_sigs(): terminating due to SIGCHLD
... but there is nothing listening:
[root@peacock kamailio]# telnet localhost 8010 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused
The SO_REUSEADDR option would solve that problem I think.
-- Alex
On 01/18/2015 04:42 PM, Daniel-Constantin Mierla wrote:
you can make a patch and if works as you expect, push it to the master. We can review then and consider it for backporting.
Okay, committed to master:cd1a59f2.