From 0c991ed00c0a5fb7f1cb5d830f4090937eb1a7f7 Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Wed, 12 Oct 2005 06:28:02 +0000 Subject: [PATCH] - honor expiration timeout returned by server --- src/register.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/register.c b/src/register.c index 91092a1..63820f5 100644 --- a/src/register.c +++ b/src/register.c @@ -612,7 +612,7 @@ int register_response(sip_ticket_t *ticket, int flag) { int register_set_expire(sip_ticket_t *ticket) { int i, j; int expires=-1; - osip_contact_t *contact; + osip_contact_t *contact=NULL; time_t time_now; osip_header_t *expires_hdr=NULL; osip_uri_param_t *expires_param=NULL; @@ -630,6 +630,7 @@ int register_set_expire(sip_ticket_t *ticket) { osip_message_get_expires(ticket->sipmsg, 0, &expires_hdr); /* loop for all existing contact headers in message */ + osip_message_get_contact(ticket->sipmsg, 0, &contact); for (j=0; contact != NULL; j++) { osip_message_get_contact(ticket->sipmsg, j, &contact); @@ -649,6 +650,8 @@ int register_set_expire(sip_ticket_t *ticket) { expires=atoi(expires_hdr->hvalue); } + DEBUGC(DBCLASS_REG,"Expires=%i, expires_param=%p, expires_hdr=%p", + expires, expires_param, expires_hdr); if (expires > 0) { /* search for an entry */ @@ -664,7 +667,7 @@ int register_set_expire(sip_ticket_t *ticket) { " entry [%i]", expires, i); urlmap[i].expires=time_now+expires; } else { - DEBUGC(DBCLASS_REG,"no urlmap entry found"); + DEBUGC(DBCLASS_REG,"no urlmap entry found"); } } } /* for j */