mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-19 01:34:13 +00:00
add auto ip-change detection and some other goodies
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9138 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
1636bc635c
commit
5fc5658e5e
10 files changed
+322
-20
No files matched your search
@@ -155,6 +155,8 @@ static char *EVENT_NAMES[] = {
|
||||
"EXE_SCHEDULE",
|
||||
"RE_SCHEDULE",
|
||||
"RELOADXML",
|
||||
"NOTIFY",
|
||||
"SEND_MESSAGE",
|
||||
"ALL"
|
||||
};
|
||||
|
||||
@@ -1068,6 +1070,46 @@ SWITCH_DECLARE(switch_status_t) switch_event_bind(const char *id, switch_event_t
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_unbind_callback(switch_event_callback_t callback)
|
||||
{
|
||||
switch_event_node_t *n, *np, *lnp = NULL;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
int id;
|
||||
|
||||
switch_thread_rwlock_wrlock(RWLOCK);
|
||||
switch_mutex_lock(BLOCK);
|
||||
/* <LOCKED> ----------------------------------------------- */
|
||||
for (id = 0; id < SWITCH_EVENT_ALL; id++) {
|
||||
lnp = NULL;
|
||||
|
||||
for (np = EVENT_NODES[id]; np;) {
|
||||
n = np;
|
||||
np = np->next;
|
||||
if (n->callback == callback) {
|
||||
if (lnp) {
|
||||
lnp->next = n->next;
|
||||
} else {
|
||||
EVENT_NODES[n->event_id] = n->next;
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Event Binding deleted for %s:%s\n", n->id, switch_event_name(n->event_id));
|
||||
n->subclass = NULL;
|
||||
FREE(n->id);
|
||||
FREE(n);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else {
|
||||
lnp = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
switch_mutex_unlock(BLOCK);
|
||||
switch_thread_rwlock_unlock(RWLOCK);
|
||||
/* </LOCKED> ----------------------------------------------- */
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_unbind(switch_event_node_t **node)
|
||||
{
|
||||
switch_event_node_t *n, *np, *lnp = NULL;
|
||||
|
||||
Reference in new issue
Block a user