[OpenSIPS-Users] Script execution hanging

Koce koce at mentalchallenge.tk
Wed Mar 16 17:34:55 CET 2016


Hi Liviu,
  I think that it was me that made that happen.
Backtracking my steps what I did was first I call sl_send_reply("100", 
"-Trying-")
because I don't know for how long I'm going to talk to the http server.
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
chain of routes that I'm calling for that message,that has nothing to do 
with the route that I called
in the first place. And by the way I forgot and I quote from Types of 
routes 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 .
At this point I have a deadlock between Opensips that finished message 
processing and a client that is waithing for a reply.
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.
I think that I got it right now but if you think from my elaborate 
explanation I did something wrong please correct me.

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160316/133ee6a6/attachment-0001.htm>


More information about the Users mailing list