From ee44d83b0a6bc85833b6562ca180bf60427ce0c8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 21 Jul 2008 14:55:49 +0000 Subject: [PATCH] fix refactor typo git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9120 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_originate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 8ed77d188d..70d739e9a7 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -268,9 +268,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t switch_frame_t *read_frame = NULL; switch_status_t status = SWITCH_STATUS_SUCCESS; int timelimit = 60; - const char *var = switch_channel_get_variable(caller_channel, "call_timeout"); + const char *var; switch_time_t start = 0; + switch_assert(peer_channel); + if (session) { caller_channel = switch_core_session_get_channel(session); } @@ -282,7 +284,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t switch_zmalloc(write_frame.data, SWITCH_RECOMMENDED_BUFFER_SIZE); write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; - if (var) { + if (caller_channel && (var = switch_channel_get_variable(caller_channel, "call_timeout"))) { timelimit = atoi(var); if (timelimit < 0) { timelimit = 60;