<p><a href="https://github.com/saghul" class="user-mention">@saghul</a>, fair points.</p>

<blockquote>
<p>This problem is known, but it never seemed worth fixing because it would involve keeping track of the registered AoR for NAT_Contact.</p>
</blockquote>

<p>It was worth fixing for us, hence this fix which worked for our needs. It would seem that the multiple accounts from the same IP and port would be more of a corner case than the main use case.</p>

<p>In ensuring the multiple accounts case works you're sacrificing the main use case. Without this change keepalives just continue for user agents that unregister after registering for a long period.</p>

<p>In a production environment with ~70,000 user agents registering and unregistering constantly this was basically unacceptable behavior due to the continued keepalives.</p>

<p>At the least there should probably be a high-visibility note in the documentation for the module that explains that keepalives will continue to a user agent after unregister.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/pull/366#issuecomment-64352901">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciRgjEKjspa-Wo6mh5_FxBeIgsNvqks5nREuWgaJpZM4Cwn4u.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/OpenSIPS/opensips/pull/366#issuecomment-64352901"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>