]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make the park function only pre-answer and not answer
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 19 Sep 2007 19:33:03 +0000 (19:33 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 19 Sep 2007 19:33:03 +0000 (19:33 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5722 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr.c

index 6e25ecddf0b24789bc5fc88ea0b6ce073d1ed93a..5cdbb2af9ec758edb2b35918e9d11cda78d69063 100644 (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);