FS-6462 --resolve

I found a problem here but it may not completely match your expectations.
I reviewed the RFC 4028 and checked against the code and I discovered we should not be putting a Min-SE in any response at all besides a 422:

section 5:

   The Min-SE header field MUST NOT be used in responses except for
   those with a 422 response code.  It indicates the minimum value of
   the session interval that the server is willing to accept.

I corrected this problem and implemented the 422 response so if you request a value lower than the minimum specified for the profile.
If the value is equal or higher to the minimum, it will be reflected in the Session-Expires header in the response and no Min-SE will be present.
This commit is contained in:
Anthony Minessale
2014-04-17 04:26:43 +05:00
parent 264fd6ffcc
commit 41fa2c9c6a
2 changed files with 13 additions and 2 deletions
+11
View File
@@ -1819,6 +1819,16 @@ void sofia_event_callback(nua_event_t event,
case nua_i_notify:
case nua_i_info:
if (event == nua_i_invite) {
if (sip->sip_min_se && profile->minimum_session_expires) {
if (sip->sip_min_se->min_delta < profile->minimum_session_expires) {
nua_respond(nh, SIP_422_SESSION_TIMER_TOO_SMALL, NUTAG_MIN_SE(profile->minimum_session_expires), TAG_END());
goto end;
}
}
}
if (!sofia_private) {
if (sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready_inbound()) {
@@ -2538,6 +2548,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
#endif
NUTAG_APPL_METHOD("MESSAGE"),
TAG_IF(profile->session_timeout && profile->minimum_session_expires, NUTAG_MIN_SE(profile->minimum_session_expires)),
NUTAG_SESSION_TIMER(profile->session_timeout),
NTATAG_MAX_PROCEEDING(profile->max_proceeding),
TAG_IF(profile->pres_type, NUTAG_ALLOW("PUBLISH")),