add killgw _all_ to delete all gws

This commit is contained in:
Anthony Minessale
2010-03-31 15:02:50 -05:00
parent b6aaea1e9e
commit 89f399832d
3 changed files with 24 additions and 5 deletions
+10 -5
View File
@@ -2604,12 +2604,17 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
goto done;
}
if ((gateway_ptr = sofia_reg_find_gateway(argv[2]))) {
sofia_glue_del_gateway(gateway_ptr);
sofia_reg_release_gateway(gateway_ptr);
stream->write_function(stream, "+OK gateway marked for deletion.\n");
if (!strcasecmp(argv[2], "_all_")) {
sofia_glue_del_every_gateway(profile);
stream->write_function(stream, "+OK every gateway marked for deletion.\n");
} else {
stream->write_function(stream, "-ERR no such gateway.\n");
if ((gateway_ptr = sofia_reg_find_gateway(argv[2]))) {
sofia_glue_del_gateway(gateway_ptr);
sofia_reg_release_gateway(gateway_ptr);
stream->write_function(stream, "+OK gateway marked for deletion.\n");
} else {
stream->write_function(stream, "-ERR no such gateway.\n");
}
}
goto done;