<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">In hindsight and upon better understanding the requirement, David’s suggestion—or something like it, e.g. htable-based—makes more sense. <div><br></div><div>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.<br><br><div dir="ltr">—<div>Sent from mobile, with due apologies for brevity and errors.</div></div><div dir="ltr"><br><blockquote type="cite">On Oct 7, 2019, at 6:44 AM, David Villasmil <david.villasmil.work@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div><div dir="auto">You could also use the dialplan module, using the match regexp to return the GID of the incoming ip.</div></div><div dir="auto"><br></div><div dir="auto">Say all calls coming from 192.168.0.100 must use the IPs 192.168.100.2 and 3 for outbound.</div><div dir="auto"><br></div><div dir="auto">I.e.:</div><div dir="auto"><br></div><div dir="auto">Adding a record in the dialplan table which includes match_exp=“192.168.0.100”, attrs=“100”</div><div dir="auto"><br></div><div dir="auto">Adding records in the dispatcher, like:</div><div dir="auto"><br></div><div dir="auto">GID destination</div><div dir="auto">100 192.168.100.2</div><div dir="auto">100 192.168.100.3</div><div dir="auto">...</div><div dir="auto"><br></div><div dir="auto">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:</div><div dir="auto"><br></div><div dir="auto"><pre style="word-wrap:break-word;white-space:pre-wrap"> 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;</pre></div><div><div dir="auto">Hope that helps</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">David</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 7 Oct 2019 at 11:22, Alex Balashov <<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hi Oleg,<div><br></div><div>What about choosing the dispatcher group based on a hash </div><div><br></div><div><a href="https://kamailio.org/docs/modules/5.2.x/modules/cfgutils.html#cfgutils.f.core_hash" target="_blank">https://kamailio.org/docs/modules/5.2.x/modules/cfgutils.html#cfgutils.f.core_hash</a></div><div><br></div><div>over a SIP attribute that is tied to the source IP of the inbound SBC, such as $si or $fd?</div><div><br></div><div><a href="https://www.kamailio.org/wiki/cookbooks/5.2.x/pseudovariables#si_-_source_ip_address" target="_blank">https://www.kamailio.org/wiki/cookbooks/5.2.x/pseudovariables#si_-_source_ip_address</a></div><div><br></div><div><a href="https://www.kamailio.org/wiki/cookbooks/5.2.x/pseudovariables#fd_-_from_uri_domain" target="_blank">https://www.kamailio.org/wiki/cookbooks/5.2.x/pseudovariables#fd_-_from_uri_domain</a></div><div><br></div><div>— Alex<br><br><div dir="ltr">—<div>Sent from mobile, with due apologies for brevity and errors.</div></div><div dir="ltr"><br><blockquote type="cite">On Oct 7, 2019, at 5:43 AM, Oleg Belousov <<a href="mailto:obelousov@gmail.com" target="_blank">obelousov@gmail.com</a>> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"></div></blockquote></div></div><div dir="auto"><div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Hello.<br>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.<br><br><div>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<br>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.<br clear="all"><div><div dir="ltr" data-smartmail="gmail_signature">--<br><a href="http://obelousov.tel" target="_blank">obelousov.tel</a></div></div></div></div>
<span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span><a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a></span><br><span><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></span><br></div></blockquote></div></div>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div>
<span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span>sr-users@lists.kamailio.org</span><br><span>https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</span><br></div></blockquote></div></body></html>