]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4539 please test this and post new logs if necessary
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 16 Aug 2012 17:10:10 +0000 (12:10 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 16 Aug 2012 17:10:10 +0000 (12:10 -0500)
src/switch_ivr_bridge.c

index 3ca4dd271533a9d646e01f31f1766d5c5e8f79a7..f2aec42fdd91570124921542cc6190cd7f931806 100644 (file)
@@ -761,7 +761,7 @@ static switch_status_t uuid_bridge_on_hibernate(switch_core_session_t *session)
 static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *session)
 {
        switch_channel_t *channel = switch_core_session_get_channel(session);
-       switch_core_session_t *other_session;
+       switch_core_session_t *other_session = NULL;
        const char *other_uuid = NULL;
 
        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CUSTOM SOFT_EXECUTE\n", switch_channel_get_name(channel));
@@ -818,7 +818,6 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
                switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
 
                if (switch_ivr_wait_for_answer(session, other_session) != SWITCH_STATUS_SUCCESS) {
-                       switch_core_session_rwunlock(other_session);
                        if (switch_true(switch_channel_get_variable(channel, "uuid_bridge_continue_on_cancel"))) {
                                switch_channel_set_state(channel, CS_EXECUTE);
                        } else if (!switch_channel_test_flag(channel, CF_TRANSFER)) {
@@ -843,7 +842,6 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
                                        switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
                                }
                        }
-                       switch_core_session_rwunlock(other_session);
                        goto done;
                }
 
@@ -869,13 +867,17 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
                        !switch_channel_test_flag(channel, CF_REDIRECT) && state < CS_HANGUP && state != CS_ROUTING && state != CS_PARK) {
                        switch_channel_set_state(channel, CS_EXECUTE);
                }
-               switch_core_session_rwunlock(other_session);
        } else {
                switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
        }
 
  done:
 
+       if (other_session) {
+               switch_core_session_rwunlock(other_session);
+               other_session = NULL;
+       }
+
        switch_channel_clear_flag_recursive(channel, CF_BRIDGE_ORIGINATOR);
 
        return SWITCH_STATUS_FALSE;