<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Liviu,<br>
     I think that it was me that made that happen.<br>
    Backtracking my steps what I did was first I call
    sl_send_reply("100", "-Trying-")<br>
    because I don't know for how long I'm going to talk to the http
    server.<br>
    Second from route(PSTN) I call route(CGR_LCR_REQ) which in turn
    calls route(CGR_LCR_REPLY) to finish processing the request, and
    that route calls another route down the<br>
    chain of routes that I'm calling for that message,that has nothing
    to do with the route that I called<br>
    in the first place. And by the way I forgot and I quote from <small><span
        style="font-size:120%">Types of routes</span></small> page
    "Default action : if the request is not either forwarded nor
    replied, the route will simply discard the request at the end." And
    because I thought that it will auto magically continue execution
    from the line where I called route(CGR_LCR_REQ) and route(PSTN) in
    return .<br>
    At this point I have a deadlock between Opensips that finished
    message processing and a client that is waithing for a reply. <br>
    What I did was I rearranged the script execution where I first
    called  route(CGR_LCR_REQ) instead of route(PSTN) and when that
    chain of routes finished successfully I called route(PSTN) at the
    end which continued executing the rest of PSTN route logic.<br>
    I think that I got it right now but if you think from my elaborate
    explanation I did something wrong please correct me.<br>
    <br>
    <blockquote
      cite="mid:mailman.9178.1458119646.2968.users@lists.opensips.org"
      type="cite">
      <pre wrap="">Hi Koce,

Does the first async rest_post() finish successfully by having its 
resume route run? Could you please add some xlog() debugging prints, so 
we can better understand where it gets stuck exactly?

Also, do you notice this behaviour with any HTTP server (100% 
reproducible), or is it a timing corner-case of your scenario?

Liviu Chircu
OpenSIPS Developer
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>

On 14.03.2016 23:16, Koce wrote:
</pre>
      <blockquote type="cite" style="color: #000000;">
        <pre wrap=""><span class="moz-txt-citetags">&gt; </span>Hello I'm using Opensips 2.1 git version and when I try to execute the 
<span class="moz-txt-citetags">&gt; </span>outline from the routing logic below I get Opensips hanging on 
<span class="moz-txt-citetags">&gt; </span>route(CGR_LCR_REQ) when it finishes executing.What I'm trying to say 
<span class="moz-txt-citetags">&gt; </span>is it hangs on that particular line as it is expecting something.
<span class="moz-txt-citetags">&gt; </span>So I'm wondering if I need to do a return on the end of that chained 
<span class="moz-txt-citetags">&gt; </span>routing block?
<span class="moz-txt-citetags">&gt; </span>Also is there some kind of depth limit that Opensips can go in the 
<span class="moz-txt-citetags">&gt; </span>routing route calling logic where it can't find it's way back,because 
<span class="moz-txt-citetags">&gt; </span>If I comment out route(CGR_LCR_REQ) everything continues execution as 
<span class="moz-txt-citetags">&gt; </span>planned?
<span class="moz-txt-citetags">&gt; </span>######################################
<span class="moz-txt-citetags">&gt; </span>if (is_method("INVITE")) {
<span class="moz-txt-citetags">&gt; </span>  sl_send_reply("100", "-Trying-");
<span class="moz-txt-citetags">&gt; </span>  xlog("L_INFO", "LOOKUPLOCATION_INVITE: [F=$fu R=$ru D=$du M=$rm 
<span class="moz-txt-citetags">&gt; </span>IP=($si:$sp $Ri:$Rp) ID=$ci]");
<span class="moz-txt-citetags">&gt; </span>  if ($rU=~"(\+|00)?[0-9]{4,15}") {#PSTN LOGIC
<span class="moz-txt-citetags">&gt; </span>    route(PSTN);
<span class="moz-txt-citetags">&gt; </span>    xlog("L_INFO", "PSTN_PROCESSED_INVITE: [F=$fu R=$ru D=$du M=$rm 
<span class="moz-txt-citetags">&gt; </span>IP=($si:$sp $Ri:$Rp) ID=$ci]");
<span class="moz-txt-citetags">&gt; </span>  }
<span class="moz-txt-citetags">&gt; </span>#rest of is_method("INVITE") route logic
<span class="moz-txt-citetags">&gt; </span>######
<span class="moz-txt-citetags">&gt; </span>route[PSTN]{
<span class="moz-txt-citetags">&gt; </span>  route(CGR_LCR_REQ); #hanging
<span class="moz-txt-citetags">&gt; </span>#rest of PSTN route logic
<span class="moz-txt-citetags">&gt; </span>}
<span class="moz-txt-citetags">&gt;</span>
<span class="moz-txt-citetags">&gt; </span>route[CGR_LCR_REQ]{
<span class="moz-txt-citetags">&gt; </span>#var assignment and route logic
<span class="moz-txt-citetags">&gt; </span>async(rest_post(),,,CGR_LCR_REPLY)
<span class="moz-txt-citetags">&gt; </span>}
<span class="moz-txt-citetags">&gt;</span>
<span class="moz-txt-citetags">&gt; </span>route[CGR_LCR_REPLY]{
<span class="moz-txt-citetags">&gt; </span>#route logic and var assignment
<span class="moz-txt-citetags">&gt; </span>async(rest_post(),,,CLI-REQ)
<span class="moz-txt-citetags">&gt; </span>}
<span class="moz-txt-citetags">&gt; </span>#and a few more route blocks calling async as outlined between 
<span class="moz-txt-citetags">&gt; </span>CGR_LCR_REQ and CGR_LCR_REPLY
<span class="moz-txt-citetags">&gt;</span></pre>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>