explicit reloadxml in sofia as well
This commit is contained in:
parent
d4a0132415
commit
6068167208
|
@ -2957,7 +2957,6 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
|
|||
sofia_profile_t *profile = NULL;
|
||||
char *profile_name = argv[0];
|
||||
const char *err;
|
||||
switch_xml_t xml_root;
|
||||
|
||||
if (argc < 2) {
|
||||
stream->write_function(stream, "Invalid Args!\n");
|
||||
|
@ -2965,12 +2964,10 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
|
|||
}
|
||||
|
||||
if (!strcasecmp(argv[1], "start")) {
|
||||
if (argc > 2 && !strcasecmp(argv[2], "reloadxml")) {
|
||||
if ((xml_root = switch_xml_open_root(1, &err))) {
|
||||
switch_xml_free(xml_root);
|
||||
}
|
||||
stream->write_function(stream, "Reload XML [%s]\n", err);
|
||||
}
|
||||
|
||||
switch_xml_reload(&err);
|
||||
stream->write_function(stream, "Reload XML [%s]\n", err);
|
||||
|
||||
if (config_sofia(1, argv[0]) == SWITCH_STATUS_SUCCESS) {
|
||||
stream->write_function(stream, "%s started successfully\n", argv[0]);
|
||||
} else {
|
||||
|
@ -3045,12 +3042,8 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
|
|||
|
||||
if (!strcasecmp(argv[1], "rescan")) {
|
||||
|
||||
if (argc > 2 && !strcasecmp(argv[2], "reloadxml")) {
|
||||
if ((xml_root = switch_xml_open_root(1, &err))) {
|
||||
switch_xml_free(xml_root);
|
||||
}
|
||||
stream->write_function(stream, "Reload XML [%s]\n", err);
|
||||
}
|
||||
switch_xml_reload(&err);
|
||||
stream->write_function(stream, "Reload XML [%s]\n", err);
|
||||
|
||||
if (reconfig_sofia(profile) == SWITCH_STATUS_SUCCESS) {
|
||||
stream->write_function(stream, "+OK scan complete\n");
|
||||
|
@ -3147,12 +3140,8 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
|
|||
profile->name, rsec, remain, remain == 1 ? "" : "s");
|
||||
} else {
|
||||
|
||||
if (argc > 2 && !strcasecmp(argv[2], "reloadxml")) {
|
||||
if ((xml_root = switch_xml_open_root(1, &err))) {
|
||||
switch_xml_free(xml_root);
|
||||
}
|
||||
stream->write_function(stream, "Reload XML [%s]\n", err);
|
||||
}
|
||||
switch_xml_reload(&err);
|
||||
stream->write_function(stream, "Reload XML [%s]\n", err);
|
||||
|
||||
if (!strcasecmp(argv[1], "stop")) {
|
||||
sofia_clear_pflag_locked(profile, PFLAG_RUNNING);
|
||||
|
@ -3493,7 +3482,7 @@ SWITCH_STANDARD_API(sofia_function)
|
|||
const char *usage_string = "USAGE:\n"
|
||||
"--------------------------------------------------------------------------------\n"
|
||||
"sofia help\n"
|
||||
"sofia profile <profile_name> [[start|stop|restart|rescan] [reloadxml]|"
|
||||
"sofia profile <profile_name> [[start|stop|restart|rescan]|"
|
||||
"flush_inbound_reg [<call_id>] [reboot]|"
|
||||
"[register|unregister] [<gateway name>|all]|"
|
||||
"killgw <gateway name>|"
|
||||
|
@ -4634,10 +4623,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
|
|||
switch_console_set_complete("add sofia profile");
|
||||
switch_console_set_complete("add sofia profile restart all");
|
||||
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles start reloadxml");
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles stop reloadxml");
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles rescan reloadxml");
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles restart reloadxml");
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles start");
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles stop");
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles rescan");
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles restart");
|
||||
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles flush_inbound_reg");
|
||||
switch_console_set_complete("add sofia profile ::sofia::list_profiles register ::sofia::list_profile_gateway");
|
||||
|
|
Loading…
Reference in New Issue