Changeset 2933 for pjproject


Ignore:
Timestamp:
Oct 9, 2009 12:19:35 PM (15 years ago)
Author:
nanang
Message:

Ticket #954: Updated session timer to tolerate 'bad' SE (less than Min-SE specified in request) in 2xx response.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_timer.c

    r2893 r2933  
    792792            se_hdr->sess_expires < inv->timer->setting.min_se) 
    793793        { 
    794             if (st_code) 
    795                 *st_code = PJSIP_SC_SESSION_TIMER_TOO_SMALL; 
    796             pjsip_timer_end_session(inv); 
    797             return PJSIP_ERRNO_FROM_SIP_STATUS( 
    798                                             PJSIP_SC_SESSION_TIMER_TOO_SMALL); 
     794            /* See ticket #954, instead of returning non-PJ_SUCCESS (which 
     795             * may cause disconnecting call/dialog), let's just accept the 
     796             * SE and update our local SE, as long as it isn't less than 90s. 
     797             */ 
     798            if (se_hdr->sess_expires >= ABS_MIN_SE) { 
     799                PJ_LOG(3, (inv->pool->obj_name,  
     800                           "Peer responds with bad Session-Expires, %ds, " 
     801                           "which is less than Min-SE specified in request, " 
     802                           "%ds. Well, let's just accept and use it.", 
     803                           se_hdr->sess_expires, inv->timer->setting.min_se)); 
     804 
     805                inv->timer->setting.sess_expires = se_hdr->sess_expires; 
     806            } 
     807 
     808            //if (st_code) 
     809            //  *st_code = PJSIP_SC_SESSION_TIMER_TOO_SMALL; 
     810            //pjsip_timer_end_session(inv); 
     811            //return PJSIP_ERRNO_FROM_SIP_STATUS( 
     812            //                              PJSIP_SC_SESSION_TIMER_TOO_SMALL); 
    799813        } 
    800814 
Note: See TracChangeset for help on using the changeset viewer.