sip_add_tl(msg, sip,
TAG_IF(expires != 0, SIPTAG_SESSION_EXPIRES(x)),
- TAG_IF(min != 0
+ TAG_IF((!uas || sip->sip_status->st_status == 422) && (min != 0
/* Min-SE: 0 is optional with initial INVITE */
- || !initial,
+ || !initial),
SIPTAG_MIN_SE(min_se)),
TAG_IF(autorequire && refresher == nua_remote_refresher && expires != 0, SIPTAG_REQUIRE_STR("timer")),
TAG_END());
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()) {
#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")),