From d69be5862d01ea813109dfa87f7aec541863c237 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 4 May 2008 10:49:40 +0000 Subject: If regc.check_contact is disabled, and no Expires header has been found, but the server does return one single Contact header, assumes that the server is broken/unable to return the correct Contact. In this case, get the expiration from the single Contact header in the response (thanks Alan Bond) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1946 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-ua/sip_reg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pjsip/src/pjsip-ua/sip_reg.c b/pjsip/src/pjsip-ua/sip_reg.c index a183f8f1..b015170d 100644 --- a/pjsip/src/pjsip-ua/sip_reg.c +++ b/pjsip/src/pjsip-ua/sip_reg.c @@ -769,6 +769,19 @@ static void tsx_callback(void *token, pjsip_event *event) } } + /* If regc.check_contact is disabled, and no Expires header + * has been found, but the server does return one single + * Contact header, assumes that the server is broken/unable to + * return the correct Contact. In this case, get the expiration + * from the single Contact header in the response. + */ + if (expiration==NOEXP && !pjsip_cfg()->regc.check_contact && + contact_cnt==1) + { + if (contact[0]->expires >= 0) + expiration = contact[0]->expires; + } + /* When the response doesn't contain our Contact header, that * means we have been unregistered. */ -- cgit v1.2.3