[asterisk-commits] tilghman: trunk r77534 - /trunk/pbx/pbx_config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 27 11:20:55 CDT 2007


Author: tilghman
Date: Fri Jul 27 11:20:55 2007
New Revision: 77534

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77534
Log:
'dialplan save' shouldn't be converting '|' back to ',' anymore.

Modified:
    trunk/pbx/pbx_config.c

Modified: trunk/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_config.c?view=diff&rev=77534&r1=77533&r2=77534
==============================================================================
--- trunk/pbx/pbx_config.c (original)
+++ trunk/pbx/pbx_config.c Fri Jul 27 11:20:55 2007
@@ -848,31 +848,11 @@
 					fprintf(output, "exten => %s,hint,%s\n",
 						    ast_get_extension_name(p),
 						    ast_get_extension_app(p));
-				} else { /* copy and replace '|' with ',' */
+				} else {
 					const char *sep, *cid;
-					char *tempdata = "";
-					char *s;
 					const char *el = ast_get_extension_label(p);
 					char label[128] = "";
  
- 					s = ast_get_extension_app_data(p);
-					if (s) {
-						char *t;
-						tempdata = alloca(strlen(tempdata) * 2 + 1);
-
-						for (t = tempdata; *s; s++, t++) {
-							if (*s == '|')
-								*t = ',';
-							else {
-								if (*s == ',')
-									*t++ = '\\';
-								*t = *s;
-							}
-						}
-						/* Terminating NULL */
-						*t = *s;
-					}
-
 					if (ast_get_extension_matchcid(p)) {
 						sep = "/";
 						cid = ast_get_extension_cidmatch(p);
@@ -885,7 +865,7 @@
 					fprintf(output, "exten => %s%s%s,%d%s,%s(%s)\n",
 					    ast_get_extension_name(p), (ast_strlen_zero(sep) ? "" : sep), (ast_strlen_zero(cid) ? "" : cid),
 					    ast_get_extension_priority(p), label,
-					    ast_get_extension_app(p), (ast_strlen_zero(tempdata) ? "" : tempdata));
+					    ast_get_extension_app(p), (ast_strlen_zero(ast_get_extension_app_data(p)) ? "" : (const char *)ast_get_extension_app_data(p)));
 				}
 			}
 		}
@@ -984,7 +964,6 @@
 	if (app && (start = strchr(app, '(')) && (end = strrchr(app, ')'))) {
 		*start = *end = '\0';
 		app_data = start + 1;
-		ast_process_quotes_and_slashes(app_data, ',', '|');
 	} else {
 		if (app) {
 			app_data = strchr(app, ',');
@@ -1584,7 +1563,7 @@
 			ast_add_extension2(con, 0, cat, -1, NULL, NULL, iface, NULL, NULL, registrar);
 			/* If voicemail, use "stdexten" else use plain old dial */
 			if (hasvoicemail) {
-				snprintf(tmp, sizeof(tmp), "stdexten|%s|${HINT}", cat);
+				snprintf(tmp, sizeof(tmp), "stdexten,%s,${HINT}", cat);
 				ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Macro", strdup(tmp), ast_free, registrar);
 			} else {
 				ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Dial", strdup("${HINT}"), ast_free, registrar);




More information about the asterisk-commits mailing list