Would this work: use append_branch() in the
request_route, then in your failure route:
$var(temp_ru) = $ru;
t_next_contacts();
$du = $ru;
$ru = $var(temp_ru);
Unfortunately not, because the $du next hop can be different for each
branch, but $ru can be the same.
Gives me an idea though - perhaps when I call append_branch I can add a
tag to the $ru like ';nexthop=XXX.XXX.XXX.XXX:PPPP' and then extract
that in my failure route.
-Barry
-----Original Message-----
From: Barry Flanagan <barry(a)flantel.com>
Sent: Tuesday, October 10, 2023 8:24 AM
To: Ben Kaufman <bkaufman(a)bcmone.com>om>; Kamailio (SER) - Users Mailing List
<sr-users(a)lists.kamailio.org>
Subject: Re: [SR-Users] Re: Serial Forking with differing next hop for each branch?
CAUTION: This email originated from outside the organization. Do not click links or open
attachments unless you recognize the sender and know the content is safe.
On 10/10/2023 14:20, Ben Kaufman wrote:
append_branch() will automatically sort by q
value.
Yes, but I also need to specify a next hop, which append_branch does not
support. There does not appear to be any mechanism for defining both a q-value and the
d-uri. I can do one or the other but not both.
I think I will use KEMI and app_jsdt to sort them into the order I need.
-Barry
-----Original Message-----
From: Barry Flanagan via sr-users <sr-users(a)lists.kamailio.org>
Sent: Tuesday, October 10, 2023 5:15 AM
To: sr-users <sr-users(a)lists.kamailio.org>
Cc: Barry Flanagan <barry(a)flantel.com>
Subject: [SR-Users] Re: Serial Forking with differing next hop for each branch?
CAUTION: This email originated from outside the organization. Do not click links or open
attachments unless you recognize the sender and know the content is safe.
On Fri, 6 Oct 2023, at 18:55, Alex Balashov via sr-users wrote:
On 6 Oct
2023, at 10:39, Barry Flanagan via sr-users <sr-users(a)lists.kamailio.org> wrote:
On 06/10/2023 15:23, Alex Balashov via sr-users wrote:
> Hello,
>
> If you can't key by R-URI, perhaps then just store a list of routes in a database
table or similar?
Thanks. The routes are received via an API call, and are dynamic. Trying to avoid the
overhead of a database.
Ah. Then the easiest approach is probably to buffer them
into an XAVP
array and just iterate through them. R-URI can be one attribute of
each, while the destination URI/next-hop can be another.
$var(i) = 0;
while(defined $xavp(route_set[$var(i)])) {
$ru = $xavp(route_set[$var(i)]=>ruri);
$du = $xavp(route_set[$var(i)]=>duri);
$var(i) = $var(i) + 1;
}
Yes, but I also need to first sort the list by weight and priority
(q-value). For the life of me I can't find any way to sort an array in Kamailio. Will
I have to use KEMI for that?
Thanks
-Barry
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions To
unsubscribe send an email to sr-users-leave(a)lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
--
-Barry