]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3227 --resolve this looks like sane changes. My only complaint was the formatting...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 4 Apr 2011 16:55:05 +0000 (11:55 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 4 Apr 2011 16:55:05 +0000 (11:55 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_ivr_bridge.c

index 9af3963deeb2694b94faf31f52cbe9255a73897a..bcc8f75692f79326944176878288cdf995595d3b 100644 (file)
@@ -1655,6 +1655,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        const char *ip = NULL, *port = NULL;
 
                        switch_channel_set_flag(channel, CF_PROXY_MODE);
+                       if (tech_pvt->rm_encoding) {
+                               tech_pvt->rm_encoding = NULL;
+                       }
                        sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
 
                        if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
index b9aec745632b470e6f18cd75892f8176b07000b6..582b06d933794b280e120426cf925f81f2afaa15 100644 (file)
@@ -5710,6 +5710,11 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                                switch_core_event_hook_add_state_change(a_session, xfer_hanguphook);
                                                                switch_channel_set_variable(a_channel, "att_xfer_kill_uuid", switch_core_session_get_uuid(b_session));
 
+                                                               if (profile->media_options & MEDIA_OPT_BYPASS_AFTER_ATT_XFER) {
+                                                                       switch_channel_set_flag(a_channel, CF_BYPASS_MEDIA_AFTER_BRIDGE);
+                                                               }
+
+
                                                                if ((tmp = switch_channel_get_hold_music(a_channel))) {
                                                                        moh = tmp;
                                                                }
@@ -5769,6 +5774,12 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                                switch_core_session_rwunlock(tmp);
                                                        }
 
+                                                       if ((profile->media_options & MEDIA_OPT_BYPASS_AFTER_ATT_XFER) && (tmp = switch_core_session_locate(br_a))) {
+                                                               switch_channel_t *tchannel = switch_core_session_get_channel(tmp);
+                                                               switch_channel_set_flag(tchannel, CF_BYPASS_MEDIA_AFTER_BRIDGE);
+                                                               switch_core_session_rwunlock(tmp);
+                                                       }
+
                                                        switch_ivr_uuid_bridge(br_b, br_a);
                                                        switch_channel_set_variable(channel_b, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER");
                                                        nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
index 701b730fcce4ffd83a383d65cfb1162092fdb0de..66bf8ea644e529bbbae22afc1d959e2d1c541a4e 100644 (file)
@@ -729,6 +729,8 @@ void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt)
                return;
        }
 
+       tech_pvt->payload_space = 0;
+
        switch_assert(tech_pvt->session != NULL);
 
        if ((abs = switch_channel_get_variable(tech_pvt->channel, "absolute_codec_string"))) {
index dbe3b811fec7f06d28e9bfe73be3af9ba147219a..f1a6bdba22a7f9a0990b1822f5b39d81aec919f8 100644 (file)
@@ -357,11 +357,11 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
                        }
 
 
-                       if ((bypass_media_after_bridge || switch_channel_test_flag(chan_a, CF_BYPASS_MEDIA_AFTER_BRIDGE)) && switch_channel_test_flag(chan_a, CF_ANSWERED)
+                       if ((bypass_media_after_bridge || switch_channel_test_flag(chan_b, CF_BYPASS_MEDIA_AFTER_BRIDGE)) && switch_channel_test_flag(chan_a, CF_ANSWERED)
                                && switch_channel_test_flag(chan_b, CF_ANSWERED)) {
                                switch_ivr_nomedia(switch_core_session_get_uuid(session_a), SMF_REBRIDGE);
                                bypass_media_after_bridge = 0;
-                               switch_channel_clear_flag(chan_a, CF_BYPASS_MEDIA_AFTER_BRIDGE);
+                               switch_channel_clear_flag(chan_b, CF_BYPASS_MEDIA_AFTER_BRIDGE);
                                goto end_of_bridge_loop;
                        }
                }
@@ -1367,6 +1367,8 @@ static void cleanup_proxy_mode_a(switch_core_session_t *session)
                const char *sbv = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
                if (!zstr(sbv) && (sbsession = switch_core_session_locate(sbv))) {
                        switch_channel_t *sbchannel = switch_core_session_get_channel(sbsession);
+                       /* Clear this now, otherwise will cause the one we're interested in to hang up too...*/
+                       switch_channel_set_variable(sbchannel, SWITCH_SIGNAL_BRIDGE_VARIABLE, NULL);
                        switch_channel_hangup(sbchannel, SWITCH_CAUSE_ATTENDED_TRANSFER);
                        switch_core_session_rwunlock(sbsession);
                }