]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 16 Sep 2008 21:52:12 +0000 (21:52 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 16 Sep 2008 21:52:12 +0000 (21:52 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9575 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 2d7366808346f6968e7555204c6ee4588a421f5c..3ae58b3e0199ff763daa1e35b6c31848f7a282b3 100644 (file)
@@ -2181,8 +2181,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
 
        if (status == 183 && !r_sdp) {
                status = 180;
+       } 
+       
+       if (status == 180 && r_sdp) {
+               status = 183;
        }
-
+       
        if (channel && (status == 180 || status == 183) && switch_channel_test_flag(channel, CF_OUTBOUND)) {
                const char *val;
                if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {
@@ -2219,7 +2223,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                                        }
                                }
                        }
-
+                       
                        if (r_sdp) {
                                if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
                                        switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
@@ -2474,24 +2478,27 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                        }
                        goto done;
                }
-
+               
                if (channel) {
-                       if (switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
-                               switch_set_flag_locked(tech_pvt, TFLAG_ANS);
-                               switch_set_flag(tech_pvt, TFLAG_SDP);
-                               switch_channel_mark_answered(channel);
-                               if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
-                                       && (other_session = switch_core_session_locate(uuid))) {
-                                       other_channel = switch_core_session_get_channel(other_session);
-                                       switch_channel_answer(other_channel);
-                                       switch_core_session_rwunlock(other_session);
+            if (switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
+                switch_set_flag_locked(tech_pvt, TFLAG_ANS);
+                switch_set_flag(tech_pvt, TFLAG_SDP);
+                switch_channel_mark_answered(channel);
+                               if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
+                                       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
+                                               && (other_session = switch_core_session_locate(uuid))) {
+                                               other_channel = switch_core_session_get_channel(other_session);
+                                               switch_channel_answer(other_channel);
+                                               switch_core_session_rwunlock(other_session);
+                                       }
                                }
-                               goto done;
-                       }
-
+                goto done;
+            }
+                       
                        if (!r_sdp && !switch_test_flag(tech_pvt, TFLAG_SDP)) {
                                r_sdp = (const char *) switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
                        }
+
                        if (r_sdp && !switch_test_flag(tech_pvt, TFLAG_SDP)) {
                                if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
                                        switch_set_flag_locked(tech_pvt, TFLAG_ANS);