Skip to content

Commit

Permalink
Revert "Changes to stop keepalives on unregisters"
Browse files Browse the repository at this point in the history
This reverts commit 4c9a1fa.
  • Loading branch information
saghul authored and razvancrainea committed Jan 23, 2015
1 parent b280f8d commit 353a519
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions modules/nat_traversal/nat_traversal.c
Expand Up @@ -374,9 +374,11 @@ SIP_Dialog_end(SIP_Dialog *dialog)
static INLINE void
SIP_Registration_update(NAT_Contact *contact, time_t expire)
{
if (contact->registration_expire == 0)
update_stat(registered_endpoints, 1);
contact->registration_expire = expire;
if (expire > contact->registration_expire) {
if (contact->registration_expire == 0)
update_stat(registered_endpoints, 1);
contact->registration_expire = expire;
}
}

static INLINE void
Expand Down Expand Up @@ -890,10 +892,10 @@ get_register_expire(struct sip_msg *request, struct sip_msg *reply)
return 0;
}

now = time(NULL);

if (!reply->contact)
return now;
return 0;

now = time(NULL);

// request may be R/O (if we are called from the TM callback),
// thus we copy the hdr_field structures before parsing them
Expand Down Expand Up @@ -942,11 +944,7 @@ get_register_expire(struct sip_msg *request, struct sip_msg *reply)

LM_DBG("maximum expire for all contacts: %u\n", (unsigned)expire);

// If no contacts were found in the reply which match the contact
// address being registered, then it was an unregister. As such,
// we return 'now' as the expiration time, to stop keepalives

return (expire ? expire + now : now);
return (expire ? expire + now : 0);
}


Expand Down

0 comments on commit 353a519

Please sign in to comment.