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 8187a92.
  • Loading branch information
saghul committed Nov 27, 2014
1 parent 422bc7b commit e41c5e3
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions modules/nat_traversal/nat_traversal.c
Expand Up @@ -359,9 +359,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 @@ -875,10 +877,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 @@ -927,11 +929,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 e41c5e3

Please sign in to comment.