mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-13 13:07:06 +00:00
make modules unbind events and un-reserve subclasses on module unload
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8898 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
ffb2e317bb
commit
2f94f73921
15 files changed
+98
-28
No files matched your search
@@ -103,6 +103,11 @@ static struct {
|
||||
int running;
|
||||
int handles;
|
||||
char guess_ip[80];
|
||||
switch_event_node_t *in_node;
|
||||
switch_event_node_t *probe_node;
|
||||
switch_event_node_t *out_node;
|
||||
switch_event_node_t *roster_node;
|
||||
|
||||
} globals;
|
||||
|
||||
struct mdl_profile {
|
||||
@@ -1755,22 +1760,22 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load)
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
if (switch_event_bind(modname, SWITCH_EVENT_PRESENCE_IN, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_event_bind_removable(modname, SWITCH_EVENT_PRESENCE_IN, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL, &globals.in_node) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
if (switch_event_bind(modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_event_bind_removable(modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL, &globals.probe_node) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
if (switch_event_bind(modname, SWITCH_EVENT_PRESENCE_OUT, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_event_bind_removable(modname, SWITCH_EVENT_PRESENCE_OUT, SWITCH_EVENT_SUBCLASS_ANY, pres_event_handler, NULL, &globals.out_node) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
if (switch_event_bind(modname, SWITCH_EVENT_ROSTER, SWITCH_EVENT_SUBCLASS_ANY, roster_event_handler, NULL)
|
||||
if (switch_event_bind_removable(modname, SWITCH_EVENT_ROSTER, SWITCH_EVENT_SUBCLASS_ANY, roster_event_handler, NULL, &globals.roster_node)
|
||||
!= SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
@@ -1867,6 +1872,16 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown)
|
||||
ldl_global_destroy();
|
||||
}
|
||||
}
|
||||
|
||||
switch_event_free_subclass(DL_EVENT_LOGIN_SUCCESS);
|
||||
switch_event_free_subclass(DL_EVENT_LOGIN_FAILURE);
|
||||
switch_event_free_subclass(DL_EVENT_CONNECTED);
|
||||
switch_event_unbind(&globals.in_node);
|
||||
switch_event_unbind(&globals.probe_node);
|
||||
switch_event_unbind(&globals.out_node);
|
||||
switch_event_unbind(&globals.roster_node);
|
||||
|
||||
|
||||
switch_core_hash_destroy(&globals.profile_hash);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user