<p>Following the comments on commit: I understood the issue appears is revealed after a restart, so this was a safety for such cases, because the transaction is not recovered afterwards. If the dialog will be destroyed when the response is received, then retransmitted messages won't be handled properly (e.g., uac module has some features relying on dialog module), that's the reason for destroying when transaction is destroyed.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/545#issuecomment-198453173">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZaybyfqsMZOAlg88lw7Ass0GBuHCks5putmJgaJpZM4HwF38.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/kamailio/kamailio/issues/545#issuecomment-198453173"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>