[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-20 Thread Kaufman
> Does this make he variable more 'constant'? :-)

No - without quotes you're declaring it as though it were a constant.  Put it 
in quotes to indicate that it is a variable.

Kaufman

-Original Message-
From: Benoît Panizzon  
Sent: Tuesday, December 20, 2022 11:05 AM
To: Kaufman 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] Re: How to make a branch trigger persistent (still 
being active after failure route is triggered)?

Hi

> Try quoting the pseudovariable?
> 
>t_on_branch("$avp(broute_trigger)");

Does this make he variable more 'constant'? :-)

I already built a switch/case contruct around it on a REARM_B_TRIGGER route 
which I now call in every failure route.

--
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.imp.ch%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C498395d08d6d4f85273108dae2ac66d0%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638071527335909559%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Uaf1Fk6P2x41%2FYuyaCOaNE9o7fbYuNBhTAAy9bWMXbE%3D&reserved=0
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-20 Thread Benoît Panizzon
Hi

> Try quoting the pseudovariable?
> 
>t_on_branch("$avp(broute_trigger)");

Does this make he variable more 'constant'? :-)

I already built a switch/case contruct around it on a
REARM_B_TRIGGER route which I now call in every failure route.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-20 Thread Kaufman
Try quoting the pseudovariable?

   t_on_branch("$avp(broute_trigger)");


Kaufman

-Original Message-
From: Benoît Panizzon  
Sent: Friday, December 16, 2022 10:28 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: How to make a branch trigger persistent (still being 
active after failure route is triggered)?

I tought I had found the solution:

 request_route
{

$avp(dispgroup) = 2001;
$avp(broute_trigger) = "BR_TO_NATIONAL";
t_on_branch($avp(broute_trigger));
route(DISPATCHCALL);

[...]

$avp(dispgroup) = 2002;
$avp(broute_trigger) = "BR_TO_INT";
t_on_branch($avp(broute_trigger));
route(DISPATCHCALL);
}

failure_route[DISPATCH_FAILURE]
{
[...]
# Set desired Branch Trigger again to try next
# dispatcher in list.
t_on_branch($avp(broute_trigger));
route(RELAY);
exit;
}

But no...

function t_on_branch: parameter 1 is not constant

Any 'tricks'?

--
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.imp.ch%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C7e7160292c034f881bea08dadfb3ad50%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638068260065887727%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yfhnAfcj91Mk3cX7VwgpD9qIx3gZl0NEUTuLK%2Fy8HPo%3D&reserved=0
__
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-16 Thread Alex Balashov
Unfortunately, I don't believe PVs can be interpolated into any route names in 
this type of usage.

> On Dec 16, 2022, at 11:28 AM, Benoît Panizzon  wrote:
> 
> I tought I had found the solution:
> 
> request_route
> {
> 
> $avp(dispgroup) = 2001;
> $avp(broute_trigger) = "BR_TO_NATIONAL";
> t_on_branch($avp(broute_trigger));
> route(DISPATCHCALL);
> 
> [...]
> 
> $avp(dispgroup) = 2002;
> $avp(broute_trigger) = "BR_TO_INT";
> t_on_branch($avp(broute_trigger));
> route(DISPATCHCALL);
> }
> 
> failure_route[DISPATCH_FAILURE]
> {
> [...]
> # Set desired Branch Trigger again to try next
> # dispatcher in list.
> t_on_branch($avp(broute_trigger));
> route(RELAY);
> exit;
> }
> 
> But no...
> 
> function t_on_branch: parameter 1 is not constant
> 
> Any 'tricks'?
> 
> -- 
> Mit freundlichen Grüssen
> 
> -Benoît Panizzon- @ HomeOffice und normal erreichbar
> -- 
> I m p r o W a r e   A G-Leiter Commerce Kunden
> __
> 
> Zurlindenstrasse 29 Tel  +41 61 826 93 00
> CH-4133 PrattelnFax  +41 61 826 93 01
> Schweiz Web  http://www.imp.ch
> __
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-16 Thread Ovidiu Sas
Hello Benoît,

Whatever you modify on a branch, is local to the branch.
The idea is that for parallel forking one might want to send out the
INVITE in different formats.
When the call fails, in the failure route you work on the original
INVITE and you can reformat the outgoing INVITE (it's like a fresh
start).

Regards,
Ovidiu Sas

On Fri, Dec 16, 2022 at 4:11 PM Benoît Panizzon  wrote:
>
> Hi List
>
> Some time ago, during my learning curve with kamailio, I learned that a
> branch route is where you make modifications to callerId's.
>
> So I extensively re-engineered the config to move as much as possible
> of callerid modification into branch routes.
>
> But now I discovered, when a call is dispatched via dispatch group with
> multiple destinations and one destination fails, therefore the failure
> route is triggered, the branch route is not being called on the second
> attempt, thus callerid being in the wrong format.
>
> Example:
>
> dispatcher.lst
>
> As an example, consider having dispatcher group 2001 for national traffic 
> over two
> dedicated links and Dispatcher group 2002 for international traffic.
>
> 2001 sip:192.168.1.1:5060 0 0 name="Carrier1"
> 2001 sip:192.168.2.1:5060 0 0 name="Carrier1"
>
> 2002 sip:192.168.1.3:5060 0 0 name="Carrier2"
>
> request_route
> {
> # We determine where we want to send the call
> # and choose dispatch group 2001, the 'national' one.
> # But there are are other dispatch groups and branch triggers
> # set this way and routed to DISPATCHCALL
> $avp(dispgroup) = 2001;
> t_on_branch("BR_TO_NATIONAL");
> route(DISPATCHCALL);
> }
>
> route[DISPATCHCALL]
> {
> t_set_fr(12,1500); # Fast Failover
> t_set_max_lifetime(30,0);
> t_set_retr(200,800);
> if (ds_select_dst("$avp(dispgroup)", "6")) {
> if (ds_is_from_list(-1,0,"$du")) {
> t_on_failure("DISPATCH_FAILURE");
> route(RELAY);
> }
> }
> }
>
> branch_route[BR_TO_NATIONAL]
> {
> # Here I make sure, all CallerId and Header are correct for the
> # national Carrier
> }
>
> failure_route[DISPATCH_FAILURE]
> {
> if (t_check_status("(5[0-9][0-9])") or (t_branch_timeout() and 
> !t_branch_replied())) {
> # Try next DS.
> if (ds_next_dst()) {
> xlog("L_INFO", " --> retargeting request\n");
> t_on_failure("DISPATCH_FAILURE");
> route(RELAY);  RIGHT HERE!
> exit;
> }
> }
> # We fail
> xlog("L_ERROR", "Call Failed\n");
> }
>
> My issue is not, that if the call is routed after the first path failed
> (marked with  RIGHT HERE!) then the appropriate branch route is not
> triggered again and the headers are wrong. But I can not set t_on_branch
> within route[DISPATCHCALL] or route[DISPATCH_FAILURE] because this is
> called with a different pre-set branch trigger, depending on the target
> dispatch group.
>
> Is there a way to make a branch trigger more persistent?
>
> --
> Mit freundlichen Grüssen
>
> -Benoît Panizzon- @ HomeOffice und normal erreichbar
> --
> I m p r o W a r e   A G-Leiter Commerce Kunden
> __
>
> Zurlindenstrasse 29 Tel  +41 61 826 93 00
> CH-4133 PrattelnFax  +41 61 826 93 01
> Schweiz Web  http://www.imp.ch
> __
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:



-- 
VoIP Embedded, Inc.
http://www.voipembedded.com
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-16 Thread Alex Balashov
Try to re-arm the branch route (t_on_branch(...)) in your failure_route.

> On Dec 16, 2022, at 10:57 AM, Benoît Panizzon  wrote:
> 
> Hi List
> 
> Some time ago, during my learning curve with kamailio, I learned that a
> branch route is where you make modifications to callerId's.
> 
> So I extensively re-engineered the config to move as much as possible
> of callerid modification into branch routes.
> 
> But now I discovered, when a call is dispatched via dispatch group with
> multiple destinations and one destination fails, therefore the failure
> route is triggered, the branch route is not being called on the second
> attempt, thus callerid being in the wrong format.
> 
> Example:
> 
> dispatcher.lst
> 
> As an example, consider having dispatcher group 2001 for national traffic 
> over two
> dedicated links and Dispatcher group 2002 for international traffic.
> 
> 2001 sip:192.168.1.1:5060 0 0 name="Carrier1"
> 2001 sip:192.168.2.1:5060 0 0 name="Carrier1"
> 
> 2002 sip:192.168.1.3:5060 0 0 name="Carrier2"
> 
> request_route
> {
> # We determine where we want to send the call
> # and choose dispatch group 2001, the 'national' one.
> # But there are are other dispatch groups and branch triggers
> # set this way and routed to DISPATCHCALL
> $avp(dispgroup) = 2001;
> t_on_branch("BR_TO_NATIONAL");
> route(DISPATCHCALL);
> }
> 
> route[DISPATCHCALL]
> {
> t_set_fr(12,1500); # Fast Failover
> t_set_max_lifetime(30,0);
> t_set_retr(200,800);
> if (ds_select_dst("$avp(dispgroup)", "6")) {
> if (ds_is_from_list(-1,0,"$du")) {
> t_on_failure("DISPATCH_FAILURE");
> route(RELAY);
> }
> }
> }
> 
> branch_route[BR_TO_NATIONAL]
> {
> # Here I make sure, all CallerId and Header are correct for the
> # national Carrier
> }
> 
> failure_route[DISPATCH_FAILURE]
> {
> if (t_check_status("(5[0-9][0-9])") or (t_branch_timeout() and 
> !t_branch_replied())) {
> # Try next DS.
> if (ds_next_dst()) {
> xlog("L_INFO", " --> retargeting request\n");
> t_on_failure("DISPATCH_FAILURE");
> route(RELAY);  RIGHT HERE!
> exit;
> }
> }
> # We fail
> xlog("L_ERROR", "Call Failed\n");
> }
> 
> My issue is not, that if the call is routed after the first path failed
> (marked with  RIGHT HERE!) then the appropriate branch route is not
> triggered again and the headers are wrong. But I can not set t_on_branch
> within route[DISPATCHCALL] or route[DISPATCH_FAILURE] because this is
> called with a different pre-set branch trigger, depending on the target
> dispatch group.
> 
> Is there a way to make a branch trigger more persistent?
> 
> -- 
> Mit freundlichen Grüssen
> 
> -Benoît Panizzon- @ HomeOffice und normal erreichbar
> -- 
> I m p r o W a r e   A G-Leiter Commerce Kunden
> __
> 
> Zurlindenstrasse 29 Tel  +41 61 826 93 00
> CH-4133 PrattelnFax  +41 61 826 93 01
> Schweiz Web  http://www.imp.ch
> __
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-16 Thread Benoît Panizzon
I tought I had found the solution:

 request_route
{

$avp(dispgroup) = 2001;
$avp(broute_trigger) = "BR_TO_NATIONAL";
t_on_branch($avp(broute_trigger));
route(DISPATCHCALL);

[...]

$avp(dispgroup) = 2002;
$avp(broute_trigger) = "BR_TO_INT";
t_on_branch($avp(broute_trigger));
route(DISPATCHCALL);
}

failure_route[DISPATCH_FAILURE]
{
[...]
# Set desired Branch Trigger again to try next
# dispatcher in list.
t_on_branch($avp(broute_trigger));
route(RELAY);
exit;
}

But no...

function t_on_branch: parameter 1 is not constant

Any 'tricks'?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe: