MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / put_evs

Function put_evs

modules/freeswitch/fs_api.c:594–622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

592}
593
594void put_evs(fs_evs *sock)
595{
596 /* prevents deadlocks on shutdown.
597 *
598 * For the FreeSWITCH OpenSIPS module, "graceful shutdowns" are not
599 * possible, since the main process brutally murders the FS connection
600 * manager before it gets a chance to gracefully EOF its TCP connections.
601 */
602 if (sr_get_core_status() == STATE_TERMINATING)
603 return;
604
605 lock_start_write(sockets_lock);
606 lock_start_write(sockets_down_lock);
607 sock->ref--;
608 if (sock->ref == 0) {
609 if (list_empty(&sock->reconnect_list))
610 list_add(&sock->reconnect_list, fs_sockets_down);
611 }
612 lock_stop_write(sockets_down_lock);
613 lock_stop_write(sockets_lock);
614
615 LM_DBG("sock %s:%d, ref=%d, rpl_id=%lu\n", sock->host.s, sock->port,
616 sock->ref, sock->esl_reply_id);
617
618 /**
619 * We cannot immediately free the event socket, as the fd might be polled
620 * by the FreeSWITCH worker process. The ref == 0 check is done there
621 */
622}
623
624fs_evs *get_stats_evs(str *fs_url, str *tag)
625{

Callers 2

get_stats_evsFunction · 0.85
put_stats_evsFunction · 0.85

Calls 3

sr_get_core_statusFunction · 0.85
list_emptyFunction · 0.85
list_addFunction · 0.85

Tested by

no test coverage detected