提交 0ec6b813 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-3706 see if this helps, otherwise can you test it on other platforms?

上级 475cd91e
......@@ -45,6 +45,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_commands_shutdown);
SWITCH_MODULE_DEFINITION(mod_commands, mod_commands_load, mod_commands_shutdown, NULL);
static switch_mutex_t *reload_mutex = NULL;
struct cb_helper {
uint32_t row_process;
......@@ -2004,6 +2005,8 @@ SWITCH_STANDARD_API(load_function)
return SWITCH_STATUS_SUCCESS;
}
switch_mutex_lock(reload_mutex);
if (switch_xml_reload(&err) == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "+OK Reloading XML\n");
}
......@@ -2014,6 +2017,8 @@ SWITCH_STANDARD_API(load_function)
stream->write_function(stream, "-ERR [%s]\n", err);
}
switch_mutex_unlock(reload_mutex);
return SWITCH_STATUS_SUCCESS;
}
......@@ -2053,12 +2058,16 @@ SWITCH_STANDARD_API(unload_function)
return SWITCH_STATUS_SUCCESS;
}
switch_mutex_lock(reload_mutex);
if (switch_loadable_module_unload_module((char *) SWITCH_GLOBAL_dirs.mod_dir, (char *) cmd, force, &err) == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "+OK\n");
} else {
stream->write_function(stream, "-ERR [%s]\n", err);
}
switch_mutex_unlock(reload_mutex);
return SWITCH_STATUS_SUCCESS;
}
......@@ -2096,6 +2105,8 @@ SWITCH_STANDARD_API(reload_function)
return SWITCH_STATUS_SUCCESS;
}
switch_mutex_lock(reload_mutex);
if (switch_loadable_module_unload_module((char *) SWITCH_GLOBAL_dirs.mod_dir, (char *) cmd, force, &err) == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "+OK module unloaded\n");
} else {
......@@ -2112,6 +2123,8 @@ SWITCH_STANDARD_API(reload_function)
stream->write_function(stream, "-ERR loading module [%s]\n", err);
}
switch_mutex_unlock(reload_mutex);
return SWITCH_STATUS_SUCCESS;
}
......@@ -5238,6 +5251,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
switch_thread_rwlock_create(&bgapi_rwlock, pool);
switch_mutex_init(&reload_mutex, SWITCH_MUTEX_NESTED, pool);
SWITCH_ADD_API(commands_api_interface, "acl", "compare an ip to an acl list", acl_function, "<ip> <list_name>");
SWITCH_ADD_API(commands_api_interface, "alias", "Alias", alias_function, ALIAS_SYNTAX);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论