diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-05-04 10:49:40 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-05-04 10:49:40 +0000 |
commit | d69be5862d01ea813109dfa87f7aec541863c237 (patch) | |
tree | 796e59877f2c3cded79c7845c8914a17ed75cbc8 /pjsip | |
parent | 97b27055e3a9649701ff157e0893ac2b24d232bf (diff) |
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
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsip-ua/sip_reg.c | 13 |
1 files changed, 13 insertions, 0 deletions
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. */ |