I'm looking for a way to randomize the contacts for serial forking if they have the same q value (so instead of doing parallel forking to those targets).
Without taking the q value into account I could do something with the defined contacts_avp before calling t_next_contacts(). But I have no idea how to randomize and serialize the branches with the same q value after calling t_next_contacts(). Any ideas?
Hello,
On 07.06.18 16:24, Daniel Tryba wrote:
I'm looking for a way to randomize the contacts for serial forking if they have the same q value (so instead of doing parallel forking to those targets).
Without taking the q value into account I could do something with the defined contacts_avp before calling t_next_contacts(). But I have no idea how to randomize and serialize the branches with the same q value after calling t_next_contacts(). Any ideas?
the only idea that comes into my mind right now is to play with $branch(...) variable:
https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#branch_name_-_...
You should do it just after lookup location, before doing the load contacts operation.
Cheers, Daniel
Daniel-Constantin Mierla writes:
Without taking the q value into account I could do something with the defined contacts_avp before calling t_next_contacts(). But I have no idea how to randomize and serialize the branches with the same q value after calling t_next_contacts(). Any ideas?
t_load_contacts() loads the contacts into an xavp. You can rearrange them according to your wishes before starting to call t_next_contacts().
-- Juha