]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Don't double-clear state handlers when uuid_bridging
authorMathieu Rene <mrene@avgs.ca>
Fri, 30 Jan 2009 22:48:44 +0000 (22:48 +0000)
committerMathieu Rene <mrene@avgs.ca>
Fri, 30 Jan 2009 22:48:44 +0000 (22:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11568 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_bridge.c

index 2365ed61e310d312a0125e41cd4835d9c96c99f2..599ab0e3fda646c20b483edb5b16fee0f53636a4 100644 (file)
@@ -523,6 +523,22 @@ static const switch_state_handler_table_t audio_bridge_peer_state_handlers = {
        /*.on_consume_media */ audio_bridge_on_consume_media,
 };
 
+static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session);
+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);
+
+static const switch_state_handler_table_t uuid_bridge_state_handlers = {
+       /*.on_init */ NULL,
+       /*.on_routing */ NULL,
+       /*.on_execute */ NULL,
+       /*.on_hangup */ NULL,
+       /*.on_exchange_media */ NULL,
+       /*.on_soft_execute */ uuid_bridge_on_soft_execute,
+       /*.on_consume_media */ uuid_bridge_on_hibernate,
+       /*.on_hibernate */ uuid_bridge_on_hibernate,
+       /*.on_reset */ uuid_bridge_on_reset
+};
+
 static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session)
 {
        switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -551,7 +567,7 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
        const char *other_uuid = NULL;
 
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM SOFT_EXECUTE\n", switch_channel_get_name(channel));
-       switch_channel_clear_state_handler(channel, NULL);
+       switch_channel_clear_state_handler(channel, &uuid_bridge_state_handlers);
 
        if (!switch_channel_test_flag(channel, CF_ORIGINATOR)) {
                return SWITCH_STATUS_SUCCESS;
@@ -637,18 +653,6 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
        return SWITCH_STATUS_FALSE;
 }
 
-static const switch_state_handler_table_t uuid_bridge_state_handlers = {
-       /*.on_init */ NULL,
-       /*.on_routing */ NULL,
-       /*.on_execute */ NULL,
-       /*.on_hangup */ NULL,
-       /*.on_exchange_media */ NULL,
-       /*.on_soft_execute */ uuid_bridge_on_soft_execute,
-       /*.on_consume_media */ uuid_bridge_on_hibernate,
-       /*.on_hibernate */ uuid_bridge_on_hibernate,
-       /*.on_reset */ uuid_bridge_on_reset
-};
-
 static switch_status_t signal_bridge_on_hibernate(switch_core_session_t *session)
 {
        switch_channel_t *channel = NULL;