Thank you for your explanation.
The failure routeis ran in the context of the initial request and the
route reply work on reply message, this explanation helped me understand a lot
of confusion.
But I also have another question, for example:
when openbsuips received non-2xx response for register or option requet message
,
if I ignore failure route and reply route in the routing script, will
opensips forward one response or two (failure route and reply route all excute
its default action) to upstream?
if I write reply route in routing script,but it do nothing, and i write failure
route that only call t_reply(), will opensips forward one response or two
to upstream?
------------------ 原始邮件 ------------------
发件人: "Ben Newlin"<[email protected]>;
发送时间: 2019年11月21日(星期四) 晚上10:17
收件人: "OpenSIPS users mailling list"<[email protected]>;
主题: Re: [OpenSIPS-Users] confusion about the reply route and the failure
route
"Moreover, in failure route you can only drop a reply, but you cannot failover."
I think this should say in reply route.
Ben Newlin
On 11/21/19, 3:56 AM, "Users on behalf of Răzvan Crainea"
<[email protected] on behalf of [email protected]> wrote:
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
> [email protected]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users