]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5131 --resolve indeed, nice catch
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 28 Feb 2013 15:28:00 +0000 (09:28 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 28 Feb 2013 15:28:00 +0000 (09:28 -0600)
src/include/switch_utils.h
src/switch_ivr_play_say.c

index 11839ee660424d32a809637cf540d7f703fff6a5..89b60ed82d3d1082911d616dc0332fa433705b25 100644 (file)
@@ -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
index 82907832f5031e560d6ad2ccf74acfe7eed7024f..b20ce844768239d30e6f93e2d7458731cdd4a424 100644 (file)
@@ -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;
-
-                               if (*file == '[') {
-                                       tfile = switch_core_session_strdup(session, file);
-                                       if ((e = switch_find_end_paren(tfile, '[', ']'))) {
-                                               *e = '\0';
-                                               file = e + 1;
+                               int x;
+
+                               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++;