Index: pbx.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx.c,v retrieving revision 1.184 diff -u -r1.184 pbx.c --- pbx.c 11 Dec 2004 03:50:19 -0000 1.184 +++ pbx.c 12 Dec 2004 23:43:29 -0000 @@ -5530,4 +5530,28 @@ } +static char *ast_process_quotes_and_slashes(char *start, char find, char replace_with) +{ + char *dataPut = start; + int inEscape = 0; + int inQuotes = 0; + + for (; *start; start++) { + if (inEscape) { + *dataPut++ = *start; /* Always goes verbatim */ + inEscape = 0; + } else { + if (*start == '\\') { + inEscape = 1; /* Do not copy \ into the data */ + } else if (*start == '\'') { + inQuotes = 1-inQuotes; /* Do not copy ' into the data */ + } else { + /* Replace , with |, unless in quotes */ + *dataPut++ = inQuotes ? *start : ((*start==find) ? replace_with : *start); + } + } + } + *dataPut = 0; + return dataPut; +} Index: include/asterisk/pbx.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/pbx.h,v retrieving revision 1.36 diff -u -r1.36 pbx.h --- include/asterisk/pbx.h 24 Nov 2004 03:07:07 -0000 1.36 +++ include/asterisk/pbx.h 12 Dec 2004 23:44:18 -0000 @@ -583,6 +583,7 @@ int ast_parseable_goto(struct ast_channel *chan, const char *goto_string); int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority); int ast_async_goto_if_exists(struct ast_channel *chan, char* context, char *exten, int priority); +extern char *ast_process_quotes_and_slashes(char *start, char find, char replace_with); #if defined(__cplusplus) || defined(c_plusplus) } #endif Index: pbx/pbx_config.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v retrieving revision 1.51 diff -u -r1.51 pbx_config.c --- pbx/pbx_config.c 24 Oct 2004 02:53:24 -0000 1.51 +++ pbx/pbx_config.c 12 Dec 2004 23:44:18 -0000 @@ -100,34 +100,6 @@ "Example: extensions reload\n"; /* - * Static code - */ -static char *process_quotes_and_slashes(char *start, char find, char replace_with) -{ - char *dataPut = start; - int inEscape = 0; - int inQuotes = 0; - - for (; *start; start++) { - if (inEscape) { - *dataPut++ = *start; /* Always goes verbatim */ - inEscape = 0; - } else { - if (*start == '\\') { - inEscape = 1; /* Do not copy \ into the data */ - } else if (*start == '\'') { - inQuotes = 1-inQuotes; /* Do not copy ' into the data */ - } else { - /* Replace , with |, unless in quotes */ - *dataPut++ = inQuotes ? *start : ((*start==find) ? replace_with : *start); - } - } - } - *dataPut = 0; - return dataPut; -} - -/* * Implementation of functions provided by this module */ @@ -1201,7 +1173,7 @@ if (app && (start = strchr(app, '(')) && (end = strrchr(app, ')'))) { *start = *end = '\0'; app_data = start + 1; - process_quotes_and_slashes(app_data, ',', '|'); + ast_process_quotes_and_slashes(app_data, ',', '|'); } else { if (app) { app_data = strchr(app, ','); @@ -1718,7 +1690,7 @@ if (start && (end = strrchr(appl, ')'))) { *start = *end = '\0'; data = start + 1; - process_quotes_and_slashes(data, ',', '|'); + ast_process_quotes_and_slashes(data, ',', '|'); } else if (stringp!=NULL && *stringp=='"') { stringp++; data = strsep(&stringp, "\""); Index: pbx/pbx_realtime.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx/pbx_realtime.c,v retrieving revision 1.6 diff -u -r1.6 pbx_realtime.c --- pbx/pbx_realtime.c 6 Dec 2004 17:21:44 -0000 1.6 +++ pbx/pbx_realtime.c 12 Dec 2004 23:57:16 -0000 @@ -184,8 +184,9 @@ if (!ast_strlen_zero(app)) { a = pbx_findapp(app); if (a) { - if(!ast_strlen_zero(tmp)) - pbx_substitute_variables_helper(chan, tmp, appdata, sizeof(appdata) - 1); + if (!ast_strlen_zero(tmp)) + ast_process_quotes_and_slashes(tmp, ',', '|'); + pbx_substitute_variables_helper(chan, tmp, appdata, sizeof(appdata) - 1); if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\")\n", term_color(tmp1, app, COLOR_BRCYAN, 0, sizeof(tmp1)),