const char *body, const char *file, const char *convert_cmd, const char *convert_ext);
SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char close);
+static inline void switch_separate_file_params(const char *file, char **file_portion, char **params_portion)
+{
+ char *e = NULL;
+ int x;
+ char *space = strdup(file);
+
+ file = space;
- static inline switch_bool_t switch_is_file_path(const char *file)
+ *file_portion = NULL;
+ *params_portion = NULL;
+
+ for (x = 0; x < 2; x++) {
+ if (*file == '[' && *(file + 1) == *SWITCH_PATH_SEPARATOR) {
+ e = switch_find_end_paren(file, '[', ']');
+ } else if (*file == '{') {
+ e = switch_find_end_paren(file, '{', '}');
+ } else {
+ break;
+ }
+ }
+
+ if (e) {
+ file = e + 1;
+ *file_portion = strdup((char *)file);
+ *++e = '\0';
+ *params_portion = (char *)space;
+ } else {
+ *file_portion = (char *)space;
+ }
+
+ return;
+}
+
+static inline switch_bool_t switch_is_file_path(const char *file)
{
const char *e;
int r, x;
break;
}
}
+
#ifdef WIN32
r = (file && (*file == '\\' || *(file + 1) == ':' || *file == '/' || strstr(file, SWITCH_URL_SEPARATOR)));
#else
if (!switch_is_file_path(file)) {
if (!say && conference->sound_prefix) {
- if (!(dfile = switch_mprintf("%s%s%s", conference->sound_prefix, SWITCH_PATH_SEPARATOR, file))) {
- goto done;
+ char *params_portion = NULL;
+ char *file_portion = NULL;
+ switch_separate_file_params(file, &file_portion, ¶ms_portion);
+
+ if (params_portion) {
+ dfile = switch_mprintf("%s%s%s%s", params_portion, conference->sound_prefix, SWITCH_PATH_SEPARATOR, file_portion);
+ } else {
+ dfile = switch_mprintf("%s%s%s", conference->sound_prefix, SWITCH_PATH_SEPARATOR, file_portion);
}
+
file = dfile;
+ switch_safe_free(file_portion);
+ switch_safe_free(params_portion);
+
} else if (!async) {
status = conference_say(conference, file, leadin);
goto done;