From 7e27f582b2e6ad7ca50583a0dde0bf99573c7f2a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 19 Sep 2007 19:33:03 +0000 Subject: [PATCH] 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 --- src/switch_ivr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);