[SR-Users] SIP routing per MSISDN
Henning Westerholt
hw at gilawa.com
Sun Oct 30 17:34:08 CET 2022
Hello,
Actually, hashing over the same input is beneficial also for transaction stateful setups. For example if you want to route requests which are challenged for authentication and need to ensure that the second request with the authorize header is processed from the same server as the first request which was challenged.
Regarding the initial question, if you want to hash over a special part of a header or URI (like the MSISDN), you could use the algorithm 7 and put the specific information in the used pseudo-variable.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com
-----Original Message-----
From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of James Browne
Sent: Saturday, October 29, 2022 5:40 PM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Subject: Re: [SR-Users] SIP routing per MSISDN
Anthony
My understanding of hashing is that it provides pseudo-random load-balancing. It's also possibly to do random load-balancing (using rand()), but the benefit of using a hash is that the same input (RURI user, Call-ID, From URI, etc) has predictable and repeatable results.
This, I imagine, would be useful in a non-transaction-stateful setup, so that re-transmissions would necessarily be routed to the same gateway to which the first request was routed.
Suppose you have two RURI users - Alice and Bob - and you have two destinations. Suppose that md5 hashing is used (I don't know what's actually used in kamailio, though). Then the hash of "Alice" is an even number and the hash of "Bob" is an odd number. Suppose that the algorithm for hashing is a simple modulo-two arithmetic (because there are two destinations in the set). Then always calls to Alice will use one destination and always calls to Bob will use the other. This can be useful in some setups.
I suppose that if you want to route based on another parameter of the RURI, then you might want multiple destination sets, and then you might set up your own algorithm for choosing the destination set and gateway for each request.
Does this make sense?
James
On Mon, 24 Oct 2022 at 15:23, Anthony Blandin <anthony.blandin at airnity.com> wrote:
>
> Hello,
>
>
>
> I need to route SIP INVITE towards a specific node based on the MSISDN of the Request URI.
>
> I saw that the dispatcher module should be able to make this with the function ds_select_dst and the algorithm “hash over request-URI user” but I don’t understand how the routing is done if we can’t associate the request-URI user with the destination address in the dispatcher DB.
>
> Maybe my understanding of this module is wrong. Could you help me to achieve this?
>
> Thanks
>
>
>
> Anthony
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions sr-users at lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
More information about the sr-users
mailing list