]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODSOFIA-59
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Jun 2010 20:42:14 +0000 (15:42 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Jun 2010 20:42:28 +0000 (15:42 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h

index fb206cf0301e2a15828799511a27010caa6326ee..27f98edd47f627248e6ef3f6fd9ef08757f0ec6e 100644 (file)
@@ -687,6 +687,14 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
 
        if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
                char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_RESPONSE_HEADER_PREFIX);
+
+               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 (sofia_use_soa(tech_pvt)) {
                        nua_respond(tech_pvt->nh, SIP_200_OK,
                                                NUTAG_AUTOANSWER(0),
@@ -2171,6 +2179,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
                                        char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
 
+                                       tech_pvt->early_sdp = switch_core_session_strdup(tech_pvt->session, tech_pvt->local_sdp_str);
+
                                        if (sofia_use_soa(tech_pvt)) {
                                                nua_respond(tech_pvt->nh,
                                                                        SIP_183_SESSION_PROGRESS,
index fbe87a2109213b4786098eb81ffb12cf16fbe4f6..e6a857875e91a43e90e4654709d015ce7af1e6df 100644 (file)
@@ -605,6 +605,7 @@ struct private_object {
        switch_rtp_crypto_key_type_t crypto_send_type;
        switch_rtp_crypto_key_type_t crypto_recv_type;
        switch_rtp_crypto_key_type_t crypto_type;
+       char *early_sdp;
        char *local_sdp_str;
        char *last_sdp_str;
        char *dest;