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(120000,1500); # Fast Failover t_set_max_lifetime(300000,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?
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'?
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 benoit.panizzon@imp.ch 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 Pratteln Fax +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-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Try quoting the pseudovariable?
t_on_branch("$avp(broute_trigger)");
Kaufman
-----Original Message----- From: Benoît Panizzon benoit.panizzon@imp.ch Sent: Friday, December 16, 2022 10:28 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org 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
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.
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 benoit.panizzon@imp.ch Sent: Tuesday, December 20, 2022 11:05 AM To: Kaufman bkaufman@bcmone.com Cc: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org 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
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 benoit.panizzon@imp.ch 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(120000,1500); # Fast Failover t_set_max_lifetime(300000,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 Pratteln Fax +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-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
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 benoit.panizzon@imp.ch 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(120000,1500); # Fast Failover t_set_max_lifetime(300000,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 Pratteln Fax +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-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: