提交 2b950b95 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-5168 --resolve

上级 d6cd3414
...@@ -131,6 +131,7 @@ static void switch_loadable_module_runtime(void) ...@@ -131,6 +131,7 @@ static void switch_loadable_module_runtime(void)
static switch_status_t switch_loadable_module_process(char *key, switch_loadable_module_t *new_module) static switch_status_t switch_loadable_module_process(char *key, switch_loadable_module_t *new_module)
{ {
switch_event_t *event; switch_event_t *event;
int added = 0;
new_module->key = switch_core_strdup(new_module->pool, key); new_module->key = switch_core_strdup(new_module->pool, key);
...@@ -151,6 +152,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -151,6 +152,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
} }
} }
...@@ -198,6 +200,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -198,6 +200,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
} }
} }
...@@ -218,6 +221,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -218,6 +221,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.dialplan_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.dialplan_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -238,6 +242,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -238,6 +242,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.timer_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.timer_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -260,6 +265,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -260,6 +265,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.application_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.application_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -282,6 +288,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -282,6 +288,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.chat_application_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.chat_application_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -304,6 +311,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -304,6 +311,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.api_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.api_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -328,6 +336,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -328,6 +336,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.file_hash, ptr->extens[i], (const void *) ptr); switch_core_hash_insert(loadable_modules.file_hash, ptr->extens[i], (const void *) ptr);
} }
...@@ -349,6 +358,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -349,6 +358,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.speech_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.speech_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -369,6 +379,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -369,6 +379,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.asr_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.asr_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -389,6 +400,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -389,6 +400,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.directory_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.directory_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -409,6 +421,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -409,6 +421,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.chat_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.chat_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -429,6 +442,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -429,6 +442,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
switch_core_hash_insert(loadable_modules.say_hash, ptr->interface_name, (const void *) ptr); switch_core_hash_insert(loadable_modules.say_hash, ptr->interface_name, (const void *) ptr);
} }
...@@ -455,6 +469,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -455,6 +469,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
} }
...@@ -481,6 +496,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -481,6 +496,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event); switch_event_fire(&event);
added++;
} }
} }
...@@ -488,6 +504,17 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable ...@@ -488,6 +504,17 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
} }
} }
if (!added) {
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "generic");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
switch_event_fire(&event);
added++;
}
}
switch_mutex_unlock(loadable_modules.mutex); switch_mutex_unlock(loadable_modules.mutex);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
...@@ -835,6 +862,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_chat_deliver(const char *dest_proto, ...@@ -835,6 +862,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_chat_deliver(const char *dest_proto,
static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t *old_module) static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t *old_module)
{ {
switch_event_t *event; switch_event_t *event;
int removed = 0;
switch_mutex_lock(loadable_modules.mutex); switch_mutex_lock(loadable_modules.mutex);
...@@ -858,6 +886,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -858,6 +886,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "endpoint"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "endpoint");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.endpoint_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.endpoint_hash, ptr->interface_name);
} }
...@@ -893,6 +922,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -893,6 +922,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "codec"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "codec");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
} }
} }
...@@ -909,6 +939,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -909,6 +939,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "dialplan"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "dialplan");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.dialplan_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.dialplan_hash, ptr->interface_name);
} }
...@@ -925,6 +956,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -925,6 +956,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "timer"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "timer");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.timer_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.timer_hash, ptr->interface_name);
} }
...@@ -951,6 +983,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -951,6 +983,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->short_desc)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->short_desc));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.application_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.application_hash, ptr->interface_name);
} }
...@@ -977,6 +1010,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -977,6 +1010,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->short_desc)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->short_desc));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.chat_application_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.chat_application_hash, ptr->interface_name);
} }
...@@ -1006,6 +1040,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1006,6 +1040,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->desc)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->desc));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.api_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.api_hash, ptr->interface_name);
} }
...@@ -1034,6 +1069,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1034,6 +1069,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "file"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "file");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->extens[i]); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->extens[i]);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.file_hash, ptr->extens[i]); switch_core_hash_delete(loadable_modules.file_hash, ptr->extens[i]);
} }
...@@ -1062,6 +1098,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1062,6 +1098,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "speech"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "speech");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.speech_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.speech_hash, ptr->interface_name);
} }
...@@ -1088,6 +1125,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1088,6 +1125,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "asr"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "asr");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.asr_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.asr_hash, ptr->interface_name);
} }
...@@ -1114,6 +1152,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1114,6 +1152,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "directory"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "directory");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.directory_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.directory_hash, ptr->interface_name);
} }
...@@ -1140,6 +1179,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1140,6 +1179,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "chat"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "chat");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.chat_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.chat_hash, ptr->interface_name);
} }
...@@ -1164,6 +1204,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1164,6 +1204,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "say"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "say");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
switch_core_hash_delete(loadable_modules.say_hash, ptr->interface_name); switch_core_hash_delete(loadable_modules.say_hash, ptr->interface_name);
} }
...@@ -1182,6 +1223,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1182,6 +1223,7 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "management"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "management");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->relative_oid); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->relative_oid);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
} }
} }
...@@ -1199,11 +1241,20 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t ...@@ -1199,11 +1241,20 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "limit"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "limit");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event); switch_event_fire(&event);
removed++;
} }
} }
} }
} }
if (!removed) {
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "generic");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", old_module->key);
switch_event_fire(&event);
removed++;
}
}
switch_mutex_unlock(loadable_modules.mutex); switch_mutex_unlock(loadable_modules.mutex);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论