]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
minor changes
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 10 Jan 2008 00:45:28 +0000 (00:45 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 10 Jan 2008 00:45:28 +0000 (00:45 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7160 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_channel.h
src/mod/applications/mod_dptools/mod_dptools.c
src/switch_ivr_bridge.c

index 00b9b78cc661b57fc3496cf4e5dc9bb788e79628..20fc8fce6cb42ce2894daba67f9ec799d9617c4c 100644 (file)
@@ -470,7 +470,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
 SWITCH_DECLARE(char *) switch_channel_build_param_string(switch_channel_t *channel, switch_caller_profile_t *caller_profile, const char *prefix);
 SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *channel);
 
-#define switch_channel_stop_broadcast(_channel)        switch_channel_set_flag(_channel, CF_BREAK | CF_STOP_BROADCAST)
+#define switch_channel_stop_broadcast(_channel)        if (switch_channel_test_flag(_channel, CF_BROADCAST)) switch_channel_set_flag(_channel, CF_BREAK | CF_STOP_BROADCAST)
 
 /** @} */
 
index 368f5f8d2cfaf1308e1e4963b4d70ba0b621ea37..4ac4777742cc96813854392b18b98c562232993e 100644 (file)
@@ -95,6 +95,17 @@ SWITCH_STANDARD_APP(eavesdrop_function)
        }
 }
 
+
+#define eavesdrop_SYNTAX "<uuid>"
+SWITCH_STANDARD_APP(three_way_function)
+{
+       if (switch_strlen_zero(data)) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", eavesdrop_SYNTAX);
+       } else {
+               switch_ivr_eavesdrop_session(session, data, ED_MUX_READ | ED_MUX_WRITE);
+       }
+}
+
 #define SET_USER_SYNTAX "<user>@<domain>"
 SWITCH_STANDARD_APP(set_user_function)
 {
@@ -1578,6 +1589,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
        SWITCH_ADD_APP(app_interface, "execute_extension", "Execute an extension", "Execute an extension", exe_function, EXE_SYNTAX, SAF_SUPPORT_NOMEDIA);
        SWITCH_ADD_APP(app_interface, "intercept", "intercept", "intercept", intercept_function, INTERCEPT_SYNTAX, SAF_NONE);
        SWITCH_ADD_APP(app_interface, "eavesdrop", "eavesdrop on a uuid", "eavesdrop on a uuid", eavesdrop_function, eavesdrop_SYNTAX, SAF_NONE);
+       SWITCH_ADD_APP(app_interface, "three_way", "three way call with a uuid", "three way call with a uuid", three_way_function, eavesdrop_SYNTAX, SAF_NONE);
        SWITCH_ADD_APP(app_interface, "set_user", "Set a User", "Set a User", set_user_function, SET_USER_SYNTAX, SAF_SUPPORT_NOMEDIA);
        SWITCH_ADD_APP(app_interface, "stop_dtmf", "stop inband dtmf", "Stop detecting inband dtmf.", stop_dtmf_session_function, "", SAF_NONE);
        SWITCH_ADD_APP(app_interface, "start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_NONE);
index 6d24c0f0a092d35c55578f95c7cc70bfccd0cab3..45c4b2b5b135c1af80e788656b121fc7fd09a5b8 100644 (file)
@@ -311,8 +311,9 @@ static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session)
        switch_channel_clear_flag(channel, CF_TRANSFER);
 
        if (switch_channel_test_flag(channel, CF_ORIGINATOR)) {
+               printf("XXXXXXXXXXXXXXXXXXXOK\n");
                switch_channel_set_state(channel, CS_TRANSMIT);
-       }
+       } else printf("XXXXXXXXXXXXXXXXXXXWTF\n");
 
        return SWITCH_STATUS_SUCCESS;
 }
@@ -322,7 +323,7 @@ static switch_status_t uuid_bridge_on_transmit(switch_core_session_t *session)
        switch_channel_t *channel = NULL;
        switch_core_session_t *other_session;
        const char *other_uuid = NULL;
-
+       
        channel = switch_core_session_get_channel(session);
        switch_assert(channel != NULL);
 
@@ -385,7 +386,7 @@ static switch_status_t uuid_bridge_on_transmit(switch_core_session_t *session)
                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(session));
                        switch_event_fire(&event);
                }
-
+       printf("XXXXXXXXXXXXXXXXXXXBLAH\n");
                switch_ivr_multi_threaded_bridge(session, other_session, NULL, NULL, NULL);
                switch_core_session_rwunlock(other_session);
        } else {
@@ -810,8 +811,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
                        switch_channel_set_caller_profile(originator_channel, cp);
                        switch_channel_set_originatee_caller_profile(originator_channel, switch_caller_profile_clone(originator_session, originatee_cp));
 
-                       switch_channel_set_flag(originator_channel, CF_BREAK);
-                       switch_channel_set_flag(originatee_channel, CF_BREAK);
+                       switch_channel_stop_broadcast(originator_channel);
+                       switch_channel_stop_broadcast(originatee_channel);
 
                        switch_channel_set_flag(originator_channel, CF_TRANSFER);
                        switch_channel_set_flag(originatee_channel, CF_TRANSFER);