mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-13 02:37:22 +00:00
add patch from FSCORE-208
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10113 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
40a050c6b7
commit
65c91197b9
@ -25,6 +25,7 @@
|
|||||||
*
|
*
|
||||||
* Anthony Minessale II <anthmct@yahoo.com>
|
* Anthony Minessale II <anthmct@yahoo.com>
|
||||||
* Michael Jerris <mike@jerris.com>
|
* Michael Jerris <mike@jerris.com>
|
||||||
|
* Travis Cross <tc@traviscross.com>
|
||||||
*
|
*
|
||||||
* switch_ivr_originate.c -- IVR Library (originate)
|
* switch_ivr_originate.c -- IVR Library (originate)
|
||||||
*
|
*
|
||||||
@ -577,6 +578,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
switch_call_cause_t reason = SWITCH_CAUSE_NONE;
|
switch_call_cause_t reason = SWITCH_CAUSE_NONE;
|
||||||
uint8_t to = 0;
|
uint8_t to = 0;
|
||||||
char *var_val, *vars = NULL;
|
char *var_val, *vars = NULL;
|
||||||
|
int var_block_count = 0;
|
||||||
|
char *e = NULL;
|
||||||
const char *ringback_data = NULL;
|
const char *ringback_data = NULL;
|
||||||
switch_codec_t *read_codec = NULL;
|
switch_codec_t *read_codec = NULL;
|
||||||
uint8_t sent_ring = 0, early_ok = 1, return_ring_ready = 0, progress = 0;
|
uint8_t sent_ring = 0, early_ok = 1, return_ring_ready = 0, progress = 0;
|
||||||
@ -611,19 +614,42 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
data++;
|
data++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*data == '{') {
|
/* extract channel variables, allowing multiple sets of braces */
|
||||||
char *e = switch_find_end_paren(data, '{', '}');
|
while (*data == '{') {
|
||||||
|
if (!var_block_count) {
|
||||||
if (e) {
|
e = switch_find_end_paren(data, '{', '}');
|
||||||
|
if (!e || !*e) {
|
||||||
|
goto var_extract_error;
|
||||||
|
}
|
||||||
vars = data + 1;
|
vars = data + 1;
|
||||||
*e++ = '\0';
|
*e = '\0';
|
||||||
data = e;
|
data = e + 1;
|
||||||
} else {
|
} else {
|
||||||
|
if (e) {
|
||||||
|
*e = ',';
|
||||||
|
}
|
||||||
|
e = switch_find_end_paren(data, '{', '}');
|
||||||
|
if (!e || !*e) {
|
||||||
|
goto var_extract_error;
|
||||||
|
}
|
||||||
|
/* swallow the opening bracket */
|
||||||
|
int i = 0, j = 0;
|
||||||
|
while ((data + i) && *(data + i)) {
|
||||||
|
j = i; i++;
|
||||||
|
/* note that this affects vars[] */
|
||||||
|
data[j] = data[i];
|
||||||
|
}
|
||||||
|
*(--e) = '\0';
|
||||||
|
data = e + 1;
|
||||||
|
}
|
||||||
|
var_block_count++;
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var_extract_error:
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
||||||
status = SWITCH_STATUS_GENERR;
|
status = SWITCH_STATUS_GENERR;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* strip leading spaces (again) */
|
/* strip leading spaces (again) */
|
||||||
while (data && *data && *data == ' ') {
|
while (data && *data && *data == ' ') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user