]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
try to fix SOA problem with early and answer audio with dissimilar sdp
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 1 Feb 2011 17:23:32 +0000 (11:23 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 1 Feb 2011 17:23:32 +0000 (11:23 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.c

index 6c91ce1274e11e3714cee3a7973a061c4e8abf12..8bceb3bba570db7863227e8c9a28873667ae070f 100644 (file)
@@ -707,11 +707,20 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
                cid = generate_pai_str(tech_pvt);
 
 
-               if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp && strcmp(tech_pvt->early_sdp, tech_pvt->local_sdp_str)) {
-                       /* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless 
-                          we do so in this case we will abandon the SOA rules and go rogue.
-                        */
-                       sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
+               if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp) {
+                       char *a, *b;
+                       
+                       /* start at the s= line to avoid some devices who update the o= between messages */
+                       a = strstr(tech_pvt->early_sdp, "s=");
+                       b = strstr(tech_pvt->local_sdp_str, "s=");
+
+                       if (!a || !b || strcmp(a, b)) {
+
+                               /* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless 
+                                  we do so in this case we will abandon the SOA rules and go rogue.
+                               */
+                               sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
+                       }
                }
 
                if (sofia_use_soa(tech_pvt)) {