Hi
I have a scenario where I need to implement serial forking but each destination has also a next hop proxy. I can do the forking using append_branch, but how can I set the destination URI for each branch? In some cases the R-URI does not change, only the next hop proxy.
Example:
R-URI Next Hop user1@domain.com XXX.XXX.XXX.XXX user1@domain.com YYY.YYY.YYY.YYY user2@domain.com XXX.XXX.XXX.XXX
I was thinking I could use a htable to store the next hop using the R-URI as the key, but as can be seen above there are possibly duplicate R-URIs with only the next hop changing.
Thanks.
Hi, Anyone have a clue how the below can be acheived?
Thanks!
-Barry
On Thu, 21 Sep 2023, at 13:52, Barry Flanagan wrote:
Hi
I have a scenario where I need to implement serial forking but each destination has also a next hop proxy. I can do the forking using append_branch, but how can I set the destination URI for each branch? In some cases the R-URI does not change, only the next hop proxy.
Example:
R-URI Next Hop user1@domain.com XXX.XXX.XXX.XXX user1@domain.com YYY.YYY.YYY.YYY user2@domain.com XXX.XXX.XXX.XXX
I was thinking I could use a htable to store the next hop using the R-URI as the key, but as can be seen above there are possibly duplicate R-URIs with only the next hop changing.
Thanks.
-- -Barry
Hello,
If you can't key by R-URI, perhaps then just store a list of routes in a database table or similar?
On 6 Oct 2023, at 08:35, Barry Flanagan via sr-users sr-users@lists.kamailio.org wrote:
Hi, Anyone have a clue how the below can be acheived?
Thanks!
-Barry
On Thu, 21 Sep 2023, at 13:52, Barry Flanagan wrote:
Hi
I have a scenario where I need to implement serial forking but each destination has also a next hop proxy. I can do the forking using append_branch, but how can I set the destination URI for each branch? In some cases the R-URI does not change, only the next hop proxy.
Example:
R-URI Next Hop user1@domain.com XXX.XXX.XXX.XXX user1@domain.com YYY.YYY.YYY.YYY user2@domain.com XXX.XXX.XXX.XXX
I was thinking I could use a htable to store the next hop using the R-URI as the key, but as can be seen above there are possibly duplicate R-URIs with only the next hop changing.
Thanks.
-- -Barry
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:
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.
-Barry
On 6 Oct 2023, at 08:35, Barry Flanagan via sr-users sr-users@lists.kamailio.org wrote:
Hi, Anyone have a clue how the below can be acheived?
Thanks!
-Barry
On Thu, 21 Sep 2023, at 13:52, Barry Flanagan wrote:
Hi
I have a scenario where I need to implement serial forking but each destination has also a next hop proxy. I can do the forking using append_branch, but how can I set the destination URI for each branch? In some cases the R-URI does not change, only the next hop proxy.
Example:
R-URI Next Hop user1@domain.com XXX.XXX.XXX.XXX user1@domain.com YYY.YYY.YYY.YYY user2@domain.com XXX.XXX.XXX.XXX
I was thinking I could use a htable to store the next hop using the R-URI as the key, but as can be seen above there are possibly duplicate R-URIs with only the next hop changing.
Thanks.
-- -Barry
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:
On 6 Oct 2023, at 10:39, Barry Flanagan via sr-users sr-users@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; }
-- Alex
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@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
On 10 Oct 2023, at 06:15, Barry Flanagan barry@flantel.com wrote:
On Fri, 6 Oct 2023, at 18:55, Alex Balashov via sr-users wrote:
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?
There is not a way to sort an existing an array, but you have two options:
1) Have the API call return the list already sorted;
2) Create a temporary array, then iterate over it and insert the elements from it into the ultimate array, in a sorted manner (i.e. insertion sort).
#1 makes the most sense to me.
As far as Kamailio config script has come with bells and whistles, it's still not a general-purpose programming runtime, and there will always be these kinds of limitations. You should conceive of Kamailio as a relatively naive consumer of data. As you surmise, that's why KEMI exists. However, the most natural answer here is to have the API return presorted data, or sort it somewhere along the way as part of some intermediate pipeline, before it is consumed by Kamailio.
-- Alex
On 10.10.23 12:15, Barry Flanagan via sr-users wrote:
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@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?
Have you tried to push to branches (e.g., with $sbranch(...), see also pv module for corresponding functions) then use tm for serial forking with those branches?
- https://www.kamailio.org/docs/modules/stable/modules/tm.html#tm.serial_forki...
Otherwise, as suggested in other replies, I would rather make the api to return the right order, or, as you pointed, use KEMI for sorting -- app_jsdt has no external dependency, its js interpreter is embedded in kamailio module.
Cheers, Daniel
append_branch() will automatically sort by q value.
-----Original Message----- From: Barry Flanagan via sr-users sr-users@lists.kamailio.org Sent: Tuesday, October 10, 2023 5:15 AM To: sr-users sr-users@lists.kamailio.org Cc: Barry Flanagan barry@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@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@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
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@lists.kamailio.org Sent: Tuesday, October 10, 2023 5:15 AM To: sr-users sr-users@lists.kamailio.org Cc: Barry Flanagan barry@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@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@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
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);
-----Original Message----- From: Barry Flanagan barry@flantel.com Sent: Tuesday, October 10, 2023 8:24 AM To: Ben Kaufman bkaufman@bcmone.com; Kamailio (SER) - Users Mailing List sr-users@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@lists.kamailio.org Sent: Tuesday, October 10, 2023 5:15 AM To: sr-users sr-users@lists.kamailio.org Cc: Barry Flanagan barry@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@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@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
On 10/10/2023 15:09, Ben Kaufman wrote:
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@flantel.com Sent: Tuesday, October 10, 2023 8:24 AM To: Ben Kaufman bkaufman@bcmone.com; Kamailio (SER) - Users Mailing List sr-users@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@lists.kamailio.org Sent: Tuesday, October 10, 2023 5:15 AM To: sr-users sr-users@lists.kamailio.org Cc: Barry Flanagan barry@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@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@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
On 10 Oct 2023, at 10:17, Barry Flanagan via sr-users sr-users@lists.kamailio.org wrote:
On 10/10/2023 15:09, Ben Kaufman wrote:
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.
This is good if $du is the _only_ branch-specific attribute you need to change besides R-URI, but would be poor solution if you need support for arbitrary, shifting parameters. Most call routing systems eventually evolve such.
-- Alex
Probably better to use an xavp with the ruri as the key.
-----Original Message----- From: Alex Balashov via sr-users sr-users@lists.kamailio.org Sent: Tuesday, October 10, 2023 9:53 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: Alex Balashov abalashov@evaristesys.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 10 Oct 2023, at 10:17, Barry Flanagan via sr-users sr-users@lists.kamailio.org wrote:
On 10/10/2023 15:09, Ben Kaufman wrote:
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.
This is good if $du is the _only_ branch-specific attribute you need to change besides R-URI, but would be poor solution if you need support for arbitrary, shifting parameters. Most call routing systems eventually evolve such.
-- Alex
-- Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com/ Tel: +1-706-510-6800
__________________________________________________________ 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:
10 Oct 2023 18:12:10 Ben Kaufman via sr-users sr-users@lists.kamailio.org:
Probably better to use an xavp with the ruri as the key.
Yes, except ruri can be the same, with only the next hop proxy and q-value changing :-(
I will work on adding a Param to ruri before append_branch containing the next hop and deal with it in failure_route.
Thanks for all the replies!
-Barry
-----Original Message----- From: Alex Balashov via sr-users sr-users@lists.kamailio.org Sent: Tuesday, October 10, 2023 9:53 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: Alex Balashov abalashov@evaristesys.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 10 Oct 2023, at 10:17, Barry Flanagan via sr-users sr-users@lists.kamailio.org wrote:
On 10/10/2023 15:09, Ben Kaufman wrote:
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.
This is good if $du is the _only_ branch-specific attribute you need to change besides R-URI, but would be poor solution if you need support for arbitrary, shifting parameters. Most call routing systems eventually evolve such.
-- Alex
-- Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com/ Tel: +1-706-510-6800
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: __________________________________________________________ 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:
-Barry Flanagan
I would reiterate that in doing this, you may be boxing yourself into only supporting Q-value and $du as parameters, more or less.
If that fits your design parameters, cool. However, if additional future route options are a possibility, you'd be better off with a generic XAVP approach. It's more work up front, but will pay dividends if you decide you need another attribute, and then another, and another...
-- Alex
On 10 Oct 2023, at 13:47, Barry Flanagan via sr-users sr-users@lists.kamailio.org wrote:
10 Oct 2023 18:12:10 Ben Kaufman via sr-users sr-users@lists.kamailio.org:
Probably better to use an xavp with the ruri as the key.
Yes, except ruri can be the same, with only the next hop proxy and q-value changing :-(
I will work on adding a Param to ruri before append_branch containing the next hop and deal with it in failure_route.
Thanks for all the replies!
10 Oct 2023 19:24:55 Alex Balashov via sr-users sr-users@lists.kamailio.org:
I would reiterate that in doing this, you may be boxing yourself into only supporting Q-value and $du as parameters, more or less.
If that fits your design parameters, cool. However, if additional future route options are a possibility, you'd be better off with a generic XAVP approach. It's more work up front, but will pay dividends if you decide you need another attribute, and then another, and another...
Thanks Alex. What I am thinking of is not to put the nh proxy into the tag directly, but instead a reference to an xavp, so the xavp could be expanded if needed in future.
-Barry
-- Alex
On 10 Oct 2023, at 13:47, Barry Flanagan via sr-users sr-users@lists.kamailio.org wrote:
10 Oct 2023 18:12:10 Ben Kaufman via sr-users sr-users@lists.kamailio.org:
Probably better to use an xavp with the ruri as the key.
Yes, except ruri can be the same, with only the next hop proxy and q-value changing :-(
I will work on adding a Param to ruri before append_branch containing the next hop and deal with it in failure_route.
Thanks for all the replies!
-- Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com Tel: +1-706-510-6800
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:
-Barry Flanagan
Barry,
If I understand this correctly, it has the problem of creating two competing sources of truth. I still think it would be better to rely on one XAVP held in state.
— Sent from mobile, apologies for brevity and errors.
On Oct 10, 2023, at 2:32 PM, Barry Flanagan barry@flantel.com wrote:
10 Oct 2023 19:24:55 Alex Balashov via sr-users sr-users@lists.kamailio.org:
I would reiterate that in doing this, you may be boxing yourself into only supporting Q-value and $du as parameters, more or less.
If that fits your design parameters, cool. However, if additional future route options are a possibility, you'd be better off with a generic XAVP approach. It's more work up front, but will pay dividends if you decide you need another attribute, and then another, and another...
Thanks Alex. What I am thinking of is not to put the nh proxy into the tag directly, but instead a reference to an xavp, so the xavp could be expanded if needed in future.
-Barry
-- Alex
On 10 Oct 2023, at 13:47, Barry Flanagan via sr-users sr-users@lists.kamailio.org wrote:
10 Oct 2023 18:12:10 Ben Kaufman via sr-users sr-users@lists.kamailio.org:
Probably better to use an xavp with the ruri as the key.
Yes, except ruri can be the same, with only the next hop proxy and q-value changing :-(
I will work on adding a Param to ruri before append_branch containing the next hop and deal with it in failure_route.
Thanks for all the replies!
-- Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com Tel: +1-706-510-6800
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:
-Barry Flanagan
Oh. I thought Barry meant that he needed to turn priorities into q-values.
On 10 Oct 2023, at 09:20, Ben Kaufman via sr-users sr-users@lists.kamailio.org wrote:
append_branch() will automatically sort by q value.
-----Original Message----- From: Barry Flanagan via sr-users sr-users@lists.kamailio.org Sent: Tuesday, October 10, 2023 5:15 AM To: sr-users sr-users@lists.kamailio.org Cc: Barry Flanagan barry@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@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@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-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: