<p>Here's a preliminary patch we put together:</p>

<p><a href="https://gist.github.com/wakamoleguy/dc9d694e64364ba6f7d2">https://gist.github.com/wakamoleguy/dc9d694e64364ba6f7d2</a></p>

<p>We haven't tested it yet, or even really compiled it.  The general idea is that if a process detects that it is about to throw away an old presentity, it still waits its turn and calls next_turn_phtable on the old one before moving on.</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/issues/754#issuecomment-171682508">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciUDOVB7UYtAtSU4znWuVdZvuYqObks5pZ72tgaJpZM4HEPZn.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/issues/754#issuecomment-171682508"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>