Thanks, Alex, David. Will check your suggestions.


On Mon, Oct 7, 2019 at 1:51 PM Alex Balashov <abalashov@evaristesys.com> wrote:
In hindsight and upon better understanding the requirement, David’s suggestion—or something like it, e.g. htable-based—makes more sense. 

Hashing would only ensure that given incoming IP X, the same outbound dispatcher set is chosen, which is what I thought you were trying to achieve. But it doesn’t allow you to dictate what that set will actually be, only that it will be consistent.

Sent from mobile, with due apologies for brevity and errors.

On Oct 7, 2019, at 6:44 AM, David Villasmil <david.villasmil.work@gmail.com> wrote:


You could also use the dialplan module, using the match regexp to return the GID of the incoming ip.

Say all calls coming from 192.168.0.100 must use the IPs 192.168.100.2 and 3 for outbound.

I.e.:

Adding a record in the dialplan table which includes match_exp=“192.168.0.100”, attrs=“100”

Adding records in the dispatcher, like:

GID destination
100 192.168.100.2
100 192.168.100.3
...

Then use the inbound source_ip (192.168.0.100) to match using dialplan then getting the list of destinations from the dispatcher, something like:

    dp_match("1", "$si");
    xlog("[DISPATCH] inbound '$si' will use dispatcher GID: '$var(dispatcher_id)'\n");
    xlog("[DISPATCH] avp(dsdstid): $avp(dsdstid)\n");

    if(!ds_select_dst("$var(dispatcher_id)", "4"))
    {
        send_reply("404", "No destination");
        exit;
    } else {
        xlog("[DISPATCH] ds_select_dst was succesful'\n");
    }
    xlog("L_DBG", "--- SCRIPT: going to <$ru> via <$du>\n");
    t_on_failure("RTF_DISPATCH");
    route(RELAY);
    exit;
Hope that helps


David

On Mon, 7 Oct 2019 at 11:22, Alex Balashov <abalashov@evaristesys.com> wrote:
Hi Oleg,

What about choosing the dispatcher group based on a hash 


over a SIP attribute that is tied to the source IP of the inbound SBC, such as $si or $fd?



— Alex

Sent from mobile, with due apologies for brevity and errors.

On Oct 7, 2019, at 5:43 AM, Oleg Belousov <obelousov@gmail.com> wrote:


Hello.
In our setup kamailio perfoms some logic depending on call direction, inbound or outbound. Call direction is identified by 2 SBC IP (IP_inbound/IP_outbound), we currently use for that 2 dispatcher groups and that is working fine.

Now number of peer nodes increased from one SBC till few tens, but we still need to keep SIP-links adjacency, meaning that call which arrived from SBC_N IP_inbound
need to be submitted via same SBC_N IP_outbound and vice versa. There could be few approaches to implement that requirement, I'm wondering if can use existing dispatcher function/select destination logic to support SIP-links adjacency.
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Regards,

David Villasmil
phone: +34669448337
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users