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
This commit is contained in:
Anthony Minessale 2007-09-19 19:33:03 +00:00
parent cdaa2abe85
commit 7e27f582b2

View File

@ -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);