It’s in pjproject/pjsip/src/pjsip-ua/sip_timer.c. There is also a comment:
||/* Update SE. Session-Expires in response cannot be lower than Min-SE.|
|| * Session-Expires in response can only be equal or lower than in |
|| * request.|
|| */|
if (se_hdr && se_hdr->sess_expires <= inv->timer->setting.sess_expires && se_hdr->sess_expires >= inv->timer->setting.min_se)
{
/* Good SE from remote, update local SE */
inv->timer->setting.sess_expires = se_hdr->sess_expires;
}
so on processing response, PJSIP takes own timer value from INVITE, and change it only if value from response is lower. Is that correct?
I checked RFC 4028 and it looks like it’s correct:
Similarly, if the side not performing refreshes does not receive a
session refresh request before the session expiration, it SHOULD send
a BYE to terminate the session, slightly before the session
expiration. The minimum of 32 seconds and one third of the session
interval is RECOMMENDED.