revert half fixed bug (426)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
ee342cc3b8
commit
171865492f
|
@ -903,8 +903,6 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char filename[256];
|
char filename[256];
|
||||||
struct ast_context *c;
|
struct ast_context *c;
|
||||||
struct ast_config *cfg;
|
|
||||||
struct ast_variable *var;
|
|
||||||
int context_header_written;
|
int context_header_written;
|
||||||
int incomplete = 0; /* incomplete config write? */
|
int incomplete = 0; /* incomplete config write? */
|
||||||
FILE *output;
|
FILE *output;
|
||||||
|
@ -924,9 +922,6 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
||||||
return RESULT_FAILURE;
|
return RESULT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load old file first */
|
|
||||||
cfg = ast_load(config);
|
|
||||||
|
|
||||||
/* have config path? */
|
/* have config path? */
|
||||||
if (argc == 3) {
|
if (argc == 3) {
|
||||||
/* is there extension.conf too? */
|
/* is there extension.conf too? */
|
||||||
|
@ -951,8 +946,6 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
||||||
if (ast_lock_contexts()) {
|
if (ast_lock_contexts()) {
|
||||||
ast_cli(fd, "Failed to lock contexts list\n");
|
ast_cli(fd, "Failed to lock contexts list\n");
|
||||||
ast_mutex_unlock(&save_dialplan_lock);
|
ast_mutex_unlock(&save_dialplan_lock);
|
||||||
if (cfg)
|
|
||||||
ast_destroy(cfg);
|
|
||||||
return RESULT_FAILURE;
|
return RESULT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -962,8 +955,6 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
||||||
filename);
|
filename);
|
||||||
ast_unlock_contexts();
|
ast_unlock_contexts();
|
||||||
ast_mutex_unlock(&save_dialplan_lock);
|
ast_mutex_unlock(&save_dialplan_lock);
|
||||||
if (cfg)
|
|
||||||
ast_destroy(cfg);
|
|
||||||
return RESULT_FAILURE;
|
return RESULT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -972,15 +963,6 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
||||||
static_config ? "yes" : "no",
|
static_config ? "yes" : "no",
|
||||||
write_protect_config ? "yes" : "no");
|
write_protect_config ? "yes" : "no");
|
||||||
|
|
||||||
var = ast_variable_walk(cfg, "globals");
|
|
||||||
if (var) {
|
|
||||||
fprintf(output, "[globals]\n");
|
|
||||||
while(var) {
|
|
||||||
fprintf(output, "%s => %s", var->name, var->value);
|
|
||||||
var = var->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* walk all contexts */
|
/* walk all contexts */
|
||||||
c = ast_walk_contexts(NULL);
|
c = ast_walk_contexts(NULL);
|
||||||
while (c) {
|
while (c) {
|
||||||
|
@ -1097,8 +1079,6 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
||||||
ast_unlock_contexts();
|
ast_unlock_contexts();
|
||||||
ast_mutex_unlock(&save_dialplan_lock);
|
ast_mutex_unlock(&save_dialplan_lock);
|
||||||
fclose(output);
|
fclose(output);
|
||||||
if (cfg)
|
|
||||||
ast_destroy(cfg);
|
|
||||||
|
|
||||||
if (incomplete) {
|
if (incomplete) {
|
||||||
ast_cli(fd, "Saved dialplan is incomplete\n");
|
ast_cli(fd, "Saved dialplan is incomplete\n");
|
||||||
|
|
Loading…
Reference in New Issue