Re: [SR-Users] behaviour of exit();

2016-01-11 Thread Daniel-Constantin Mierla
Hello,

in a failure_route, exit stops the execution of the config file and then
kamailio will send the winning reply to the caller if there is no active
branch. If you did a t_relay() to a new destination in failure_route,
then that is an active branch, so no reply is sent to caller, kamailio
will wait for the active branch to get a reply or time out.

Cheers,
Daniel

On 11/01/16 10:20, Grant Bagdasarian wrote:
>
> Hello,
>
>  
>
> I have the following statements in my config script.
>
> When either of the IF statements is true, what does the exit function
> do? Will it still pass the message to the next hop or will it just
> abort and drop the sip message?
>
>  
>
> failure_route[DISPATCH_FAILURE] {
>
> xlog("L_INFO", "[R-FAILURE-ROUTE-DISPATCH-FAILURE:$ci]
> !>"
> "Route:DISPATCH_FAILURE;UnixTime:$TV(un);RequestURI:$rU;RequestMethod:$rm;Status:$rs;FromTag:$ft;ToTag:$tt;CallID:$ci;From:$fU;To:$rU\r\n");
>
>  
>
> t_on_branch("MSG_MOD");
>
>  
>
> if(t_is_expired()) {
>
>xlog("L_INFO",
> "[R-FAILURE-ROUTE-DISPATCH-FAILURE:$ci] !>" "Transaction expired -
> aborting\r\n");
>
>exit;
>
> }
>
>  
>
> if (t_is_canceled()) {
>
>xlog("L_INFO",
> "[R-FAILURE-ROUTE-DISPATCH-FAILURE:$ci] !>" "Transaction cancelled -
> aborting\r\n");
>
>exit;
>
> }
>
>  
>
> Thanks.
>
>  
>
> Regards,
>
>  
>
> Grant
>
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] behaviour of exit();

2016-01-11 Thread Grant Bagdasarian
Thank you Daniel, it's clear for me now :)

From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of 
Daniel-Constantin Mierla
Sent: Monday, January 11, 2016 10:33 AM
To: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] behaviour of exit();

Hello,

in a failure_route, exit stops the execution of the config file and then 
kamailio will send the winning reply to the caller if there is no active 
branch. If you did a t_relay() to a new destination in failure_route, then that 
is an active branch, so no reply is sent to caller, kamailio will wait for the 
active branch to get a reply or time out.

Cheers,
Daniel
On 11/01/16 10:20, Grant Bagdasarian wrote:
Hello,

I have the following statements in my config script.
When either of the IF statements is true, what does the exit function do? Will 
it still pass the message to the next hop or will it just abort and drop the 
sip message?

failure_route[DISPATCH_FAILURE] {
xlog("L_INFO", "[R-FAILURE-ROUTE-DISPATCH-FAILURE:$ci] !>" 
"Route:DISPATCH_FAILURE;UnixTime:$TV(un);RequestURI:$rU;RequestMethod:$rm;Status:$rs;FromTag:$ft;ToTag:$tt;CallID:$ci;From:$fU;To:$rU\r\n");

t_on_branch("MSG_MOD");

if(t_is_expired()) {
   xlog("L_INFO", 
"[R-FAILURE-ROUTE-DISPATCH-FAILURE:$ci] !>" "Transaction expired - 
aborting\r\n");
   exit;
}

if (t_is_canceled()) {
   xlog("L_INFO", 
"[R-FAILURE-ROUTE-DISPATCH-FAILURE:$ci] !>" "Transaction cancelled - 
aborting\r\n");
   exit;
}

Thanks.

Regards,

Grant




___

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users@lists.sip-router.org<mailto:sr-users@lists.sip-router.org>

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



--

Daniel-Constantin Mierla

http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

Book: SIP Routing With Kamailio - http://www.asipto.com

http://miconda.eu
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users