[Asterisk-cvs] asterisk/pbx pbx_config.c,1.43,1.44
markster at lists.digium.com
markster at lists.digium.com
Sat Aug 21 15:09:34 CDT 2004
Update of /usr/cvsroot/asterisk/pbx
In directory localhost.localdomain:/tmp/cvs-serv5678/pbx
Modified Files:
pbx_config.c
Log Message:
Save CID and switches in "save dialplan" command (bug #2279)
Index: pbx_config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- pbx_config.c 21 Jun 2004 14:20:03 -0000 1.43
+++ pbx_config.c 21 Aug 2004 18:55:39 -0000 1.44
@@ -1016,6 +1016,7 @@
struct ast_exten *e, *last_written_e = NULL;
struct ast_include *i;
struct ast_ignorepat *ip;
+ struct ast_sw *sw;
/* registered by this module? */
if (!strcmp(ast_get_context_registrar(c), registrar)) {
@@ -1058,11 +1059,19 @@
}
tempdata = startdata;
}
- fprintf(output, "exten => %s,%d,%s(%s)\n",
- ast_get_extension_name(p),
- ast_get_extension_priority(p),
- ast_get_extension_app(p),
- tempdata);
+ if (ast_get_extension_matchcid(p))
+ fprintf(output, "exten => %s/%s,%d,%s(%s)\n",
+ ast_get_extension_name(p),
+ ast_get_extension_cidmatch(p),
+ ast_get_extension_priority(p),
+ ast_get_extension_app(p),
+ tempdata);
+ else
+ fprintf(output, "exten => %s,%d,%s(%s)\n",
+ ast_get_extension_name(p),
+ ast_get_extension_priority(p),
+ ast_get_extension_app(p),
+ tempdata);
if (tempdata)
free(tempdata);
} else
@@ -1097,6 +1106,24 @@
if (ast_walk_context_includes(c, NULL))
fprintf(output, "\n");
+ /* walk through switches */
+ sw = ast_walk_context_switches(c, NULL);
+ while (sw) {
+ if (!strcmp(ast_get_switch_registrar(sw), registrar)) {
+ if (!context_header_written) {
+ fprintf(output, "[%s]\n", ast_get_context_name(c));
+ context_header_written = 1;
+ }
+ fprintf(output, "switch => %s/%s\n",
+ ast_get_switch_name(sw),
+ ast_get_switch_data(sw));
+ }
+ sw = ast_walk_context_switches(c, sw);
+ }
+
+ if (ast_walk_context_switches(c, NULL))
+ fprintf(output, "\n");
+
/* fireout ignorepats ... */
ip = ast_walk_context_ignorepats(c, NULL);
while (ip) {
More information about the svn-commits
mailing list