]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Remove Contact header from BYE and CANCEL requests.
authorSpencer Thomason <spencer@whiteskycommunications.com>
Tue, 16 Sep 2014 19:32:51 +0000 (19:32 +0000)
committerSpencer Thomason <spencer@whiteskycommunications.com>
Thu, 2 Oct 2014 19:24:46 +0000 (12:24 -0700)
Per rfc3261 the Contact header is not applicable and MUST not appear in
the request.

FS-5868 #resolve

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index aff86a63319af462ba9aa911e1be1b4fd464ae5d..b2f46856a737415117b3f27c6551ca0849d9d487 100644 (file)
@@ -465,6 +465,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sending BYE to %s\n", switch_channel_get_name(channel));
                        if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
                                nua_bye(tech_pvt->nh,
+                                               SIPTAG_CONTACT(SIP_NONE),
                                                TAG_IF(!zstr(reason), SIPTAG_REASON_STR(reason)),
                                                TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)),
                                                TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
@@ -478,6 +479,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
                                }
                                if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
                                        nua_cancel(tech_pvt->nh,
+                                                          SIPTAG_CONTACT(SIP_NONE),
                                                           TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)),
                                                           TAG_IF(!zstr(reason), SIPTAG_REASON_STR(reason)), TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)), TAG_END());
                                }
index 47ed827b07267b5c542c26f2298204177b3744f5..d41b99c1cfe9e175e4c76812e86c2fccf98705c6 100644 (file)
@@ -7750,6 +7750,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                                                q850 = switch_core_session_sprintf(a_session, "Q.850;cause=16;text=\"normal_clearing\"");
                                                                        }
                                                                        nua_bye(b_tech_pvt->nh,
+                                                                                       SIPTAG_CONTACT(SIP_NONE),
                                                                                        TAG_IF(!zstr(q850), SIPTAG_REASON_STR(q850)),
                                                                                        TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_END());
 
index 053ddd9a9e2f3454837a2153afa70c41ac8ec7c0..c796d0ad7e8d630934cf8124087bedc85d5ffda1 100644 (file)
@@ -2483,7 +2483,7 @@ void sofia_reg_handle_sip_r_challenge(int status,
        if (session) {
                switch_channel_hangup(switch_core_session_get_channel(session), SWITCH_CAUSE_MANDATORY_IE_MISSING);
        } else {
-               nua_cancel(nh, TAG_END());
+               nua_cancel(nh, SIPTAG_CONTACT(SIP_NONE), TAG_END());
        }
 
   end: