<p>Looking at the code I see the T_ASYNC_SUSPENDED flag is cleared at the end of t_continue(). Possible solutions:</p>

<ul>
<li>clear the flag earlier</li>
<li>use a static var to know that t_suspend() was executed inside the route block triggered by t_contine()</li>
<li>use a counter to track the level of suspend/continue stack</li>
</ul>

<p>I didn't have the time to dig more and see which one would work the best and balance if there are side effects. First option would be simpler, I guess, if that works, it should be the way to go.</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, <a href="https://github.com/kamailio/kamailio/issues/645#issuecomment-222446341">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AF36ZRugqLHrmtutWQosxKmIBRWiLA4Yks5qGqa4gaJpZM4IpP9_">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZfYuxjXP1C68hkHY6qwFpJj9jYoAks5qGqa4gaJpZM4IpP9_.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/645#issuecomment-222446341"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>