[OpenSIPS-Users] confusion about the reply route and the failure route

Răzvan Crainea razvan at opensips.org
Thu Nov 21 03:56:28 EST 2019


Hello!

By default, the replies received by OpenSIPS are relayed further, 
whether you have a reply of failure route or not. The purpose of these 
two routes is to do any processing on the messages they are processing.
Note that the scope of failure route and reply route is a bit different: 
the reply route is ran for each reply message - this means that if you 
for example add a header on a 408, that 408 message will contain the 
header. Moreover, in failure route you can only drop a reply, but you 
cannot failover.
The failure route has nothing to do with replies processing - it is ran 
in the context of the initial request. This means that if you add a 
header in failure route, it will not appear in any replies! However, if 
you run t_relay() in failure route, you will create a new branch - send 
the request to a new upstream - that request will contain the added 
header. The only thing that failure route running relates to replies is 
the fact that if you do a t_relay() in failure route and dispatch the 
request to a new destination, no reply will be sent downstream.
To summarize, if you don't use reply route or failure route, all 
responses will be sent. The only exception to this rule is when you use 
parallel forking: send the initial request to multiple destinations in 
parallel. In such case, according to RFC 3261, OpenSIPS will only relay 
downstream the result all replies received from upstream - that is the 
lowest terminal response code.

Best regards,
Răzvan


On 11/21/19 4:30 AM, 汤世祥 wrote:
> Hi:
>      I'm a little confused about the reply route and the failure route.
>       Both can handle 404/408 responses in invite session. Both default action is to relay back the SIP reply.
>         If I omit two routes in scripts(that meas not arm the reply route by using the t_on_reply("name") function or t_on_failure("name") function) or call t_relay() in these two routing scripts, will there be two responses sent ?
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 

-- 
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com



More information about the Users mailing list