[sr-dev] EVAPI reuse socket

Alex Balashov abalashov at evaristesys.com
Sun Jan 18 22:20:46 CET 2015


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 at 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

-- 
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States

Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/



More information about the sr-dev mailing list