[sr-dev] [kamailio/kamailio] dispatcher : better distribution when using hash and destination is not available (#2363)

Daniel-Constantin Mierla notifications at github.com
Wed Jun 24 08:48:53 CEST 2020


First, the variables must be declared at the beginning of the functions/blocks, to be coherent with the rest of the code.

Then, the new code is doing new-hashing over an integer converted to string, which then do new-hashing over the returned index (again converted to string). I do not like the approach. Why not just do hashid modulo number of active destinations then selecting the destination address by iterating in the list with active destinations, instead of picking up directly by index.

Anyhow, I think the existing algorithms should stay like they are now, you can add a new algorithm hashing the value in a variable (like algorithm 7) with the re-hashing you want. Algorithm 7 can substitute all the other hashing algorithms by setting the appropriate value in the hashing variabel (eg, $var(dshash) = $ci for algorithm 0).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2363#issuecomment-648628104
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200623/c6b57dec/attachment.html>


More information about the sr-dev mailing list