From: Anthony Minessale Date: Wed, 19 Sep 2007 19:33:03 +0000 (+0000) Subject: make the park function only pre-answer and not answer X-Git-Tag: v1.0-beta2~631 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e27f582b2e6ad7ca50583a0dde0bf99573c7f2a;p=thirdparty%2Ffreeswitch.git make the park function only pre-answer and not answer git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5722 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 6e25ecddf0..5cdbb2af9e 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -413,7 +413,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session, channel = switch_core_session_get_channel(session); assert(channel != NULL); - switch_channel_answer(channel); + if (!switch_channel_test_flag(channel, CF_ANSWERED)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Careful, Channel is unaswered. Pre-answering...\n"); + switch_channel_pre_answer(channel); + } if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_PARK) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_data(channel, event);