diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 11839ee660..89b60ed82d 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -919,11 +919,19 @@ SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char clos static inline switch_bool_t switch_is_file_path(const char *file) { const char *e; - int r; + int r, x; - if (*file == '[' && *(file + 1) == *SWITCH_PATH_SEPARATOR) { - if ((e = switch_find_end_paren(file, '[', ']'))) { - file = e + 1; + for (x = 0; x < 2; x++) { + if (*file == '[' && *(file + 1) == *SWITCH_PATH_SEPARATOR) { + if ((e = switch_find_end_paren(file, '[', ']'))) { + file = e + 1; + } + } else if (*file == '{') { + if ((e = switch_find_end_paren(file, '{', '}'))) { + file = e + 1; + } + } else { + break; } } #ifdef WIN32 diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 82907832f5..b20ce84476 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1185,20 +1185,33 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess if (!strstr(file, SWITCH_URL_SEPARATOR)) { if (!switch_is_file_path(file)) { - char *tfile = NULL; + char *tfile = NULL, *tfile2 = NULL; char *e; + int x; - if (*file == '[') { - tfile = switch_core_session_strdup(session, file); - if ((e = switch_find_end_paren(tfile, '[', ']'))) { - *e = '\0'; - file = e + 1; + for (x = 0; x < 2; x++) { + if (*file == '[') { + tfile = switch_core_session_strdup(session, file); + if ((e = switch_find_end_paren(tfile, '[', ']'))) { + *e = '\0'; + file = e + 1; + } else { + tfile = NULL; + } + } else if (*file == '{') { + tfile2 = switch_core_session_strdup(session, file); + if ((e = switch_find_end_paren(tfile2, '{', '}'))) { + *e = '\0'; + file = e + 1; + } else { + tfile2 = NULL; + } } else { - tfile = NULL; + break; } } - file = switch_core_session_sprintf(session, "%s%s%s%s%s", switch_str_nil(tfile), tfile ? "]" : "", prefix, SWITCH_PATH_SEPARATOR, file); + file = switch_core_session_sprintf(session, "%s%s%s%s%s%s%s", switch_str_nil(tfile), tfile ? "]" : "", switch_str_nil(tfile2), tfile2 ? "}" : "", prefix, SWITCH_PATH_SEPARATOR, file); } if ((ext = strrchr(file, '.'))) { ext++;