summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2009-10-09 12:19:35 +0000
committerNanang Izzuddin <nanang@teluu.com>2009-10-09 12:19:35 +0000
commit6805b3670f6a0ae4e833b7bcdd42786dc1440814 (patch)
treed1e998c8f4a51a459ca1fd0d4d9434302071e561 /pjsip
parent01b60a5f21381167b24400afea23a2126d3e01ef (diff)
Ticket #954: Updated session timer to tolerate 'bad' SE (less than Min-SE specified in request) in 2xx response.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2933 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip-ua/sip_timer.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/pjsip/src/pjsip-ua/sip_timer.c b/pjsip/src/pjsip-ua/sip_timer.c
index bc2b0293..51f40c11 100644
--- a/pjsip/src/pjsip-ua/sip_timer.c
+++ b/pjsip/src/pjsip-ua/sip_timer.c
@@ -791,11 +791,25 @@ PJ_DEF(pj_status_t) pjsip_timer_process_resp(pjsip_inv_session *inv,
if (se_hdr &&
se_hdr->sess_expires < inv->timer->setting.min_se)
{
- if (st_code)
- *st_code = PJSIP_SC_SESSION_TIMER_TOO_SMALL;
- pjsip_timer_end_session(inv);
- return PJSIP_ERRNO_FROM_SIP_STATUS(
- PJSIP_SC_SESSION_TIMER_TOO_SMALL);
+ /* See ticket #954, instead of returning non-PJ_SUCCESS (which
+ * may cause disconnecting call/dialog), let's just accept the
+ * SE and update our local SE, as long as it isn't less than 90s.
+ */
+ if (se_hdr->sess_expires >= ABS_MIN_SE) {
+ PJ_LOG(3, (inv->pool->obj_name,
+ "Peer responds with bad Session-Expires, %ds, "
+ "which is less than Min-SE specified in request, "
+ "%ds. Well, let's just accept and use it.",
+ se_hdr->sess_expires, inv->timer->setting.min_se));
+
+ inv->timer->setting.sess_expires = se_hdr->sess_expires;
+ }
+
+ //if (st_code)
+ // *st_code = PJSIP_SC_SESSION_TIMER_TOO_SMALL;
+ //pjsip_timer_end_session(inv);
+ //return PJSIP_ERRNO_FROM_SIP_STATUS(
+ // PJSIP_SC_SESSION_TIMER_TOO_SMALL);
}
/* Update SE. Session-Expires in response cannot be lower than Min-SE.