diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 2ab8ea3b3c..b0ddfee7ad 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -917,12 +917,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess end = switch_find_end_paren(p, '[', ']'); } - if (end && p && *p == ',') { + if (end && p < end && *p == ',') { *p = '|'; } if (p == end) { - e = NULL; + end = NULL; } p++; @@ -954,6 +954,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } else { vdata = NULL; } + printf("WTF [%s][%s]\n", vdata, chan_type); if ((chan_data = strchr(chan_type, '/')) != 0) { *chan_data = '\0';