mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Bugfix for 7813 applied to trunk as per patch supplied by stevens
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -782,9 +782,12 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* fireout general info */
|
/* fireout general info */
|
||||||
fprintf(output, "[general]\nstatic=%s\nwriteprotect=%s\n\n",
|
fprintf(output, "[general]\nstatic=%s\nwriteprotect=%s\nautofallthrough=%s\nclearglobalvars=%s\npriorityjumping=%s\n\n",
|
||||||
static_config ? "yes" : "no",
|
static_config ? "yes" : "no",
|
||||||
write_protect_config ? "yes" : "no");
|
write_protect_config ? "yes" : "no",
|
||||||
|
autofallthrough_config ? "yes" : "no",
|
||||||
|
clearglobalvars_config ? "yes" : "no",
|
||||||
|
ast_true(ast_variable_retrieve(cfg, "general", "priorityjumping")) ? "yes" : "no");
|
||||||
|
|
||||||
if ((v = ast_variable_browse(cfg, "globals"))) {
|
if ((v = ast_variable_browse(cfg, "globals"))) {
|
||||||
fprintf(output, "[globals]\n");
|
fprintf(output, "[globals]\n");
|
||||||
@@ -850,6 +853,8 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
|||||||
const char *sep, *cid;
|
const char *sep, *cid;
|
||||||
char *tempdata = strdup(ast_get_extension_app_data(p));
|
char *tempdata = strdup(ast_get_extension_app_data(p));
|
||||||
char *s;
|
char *s;
|
||||||
|
const char *el = ast_get_extension_label(p);
|
||||||
|
char *label = calloc(1, 128);
|
||||||
|
|
||||||
if (!tempdata) { /* XXX error duplicating string ? */
|
if (!tempdata) { /* XXX error duplicating string ? */
|
||||||
incomplete = 1;
|
incomplete = 1;
|
||||||
@@ -864,11 +869,18 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
sep = cid = "";
|
sep = cid = "";
|
||||||
}
|
}
|
||||||
fprintf(output, "exten => %s%s%s,%d,%s(%s)\n",
|
if (el) {
|
||||||
|
if (snprintf(label, 127, "(%s)", el) != (strlen(el)+2)) {
|
||||||
|
incomplete = 1; /* error encountered or label > 125 chars */
|
||||||
|
label = NULL;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
fprintf(output, "exten => %s%s%s,%d%s,%s(%s)\n",
|
||||||
ast_get_extension_name(p), sep, cid,
|
ast_get_extension_name(p), sep, cid,
|
||||||
ast_get_extension_priority(p),
|
ast_get_extension_priority(p), (label)?label:"",
|
||||||
ast_get_extension_app(p), tempdata);
|
ast_get_extension_app(p), tempdata);
|
||||||
free(tempdata);
|
free(tempdata);
|
||||||
|
if (label) free(label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user