From: Mark Spencer Date: Fri, 9 Jul 2004 11:03:33 +0000 (+0000) Subject: Expire time fix (bug #1996) X-Git-Tag: 1.0.0-rc1~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=602d616726fa235bb3ccb467615594461173683b;p=thirdparty%2Fasterisk.git Expire time fix (bug #1996) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3413 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index dc34f3ee0c..6fb29092e1 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6463,8 +6463,10 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ contact = __get_header(req, "Contact", &start); /* this loop ensures we get a contact header about our register request */ if(!ast_strlen_zero(contact)) { - if(strstr(contact, p->our_contact)) + if( (tmptmp=strstr(contact, p->our_contact))) { + contact=tmptmp; break; + } } else break; } @@ -6483,6 +6485,7 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ else expires_ms -= EXPIRY_GUARD_SECS * 1000; + r->refresh= (int) expires_ms / 1000; r->expire=ast_sched_add(sched, expires_ms, sip_reregister, r); } else ast_log(LOG_WARNING, "Got 200 OK on REGISTER that isn't a register\n");