<div dir="ltr"><div>Hi Patrik,</div><div><br></div><div>It would help if you will include your config and some logs.</div><div><br></div><div>But something like this should work:</div><div><br></div><div>
if($<span class="gmail-pl-k">rU</span>=~<span class="gmail-pl-s"><span class="gmail-pl-pds">"</span>^(0201316)[0-1][0-9]$<span class="gmail-pl-pds">"</span></span>)</div><div><br></div><div>{</div><div><br></div><div>
ds_select_dst(<span class="gmail-pl-s"><span class="gmail-pl-pds">"</span>1<span class="gmail-pl-pds">"</span></span>, <span class="gmail-pl-s"><span class="gmail-pl-pds">"</span>4<span class="gmail-pl-pds">"</span></span>)

</div><div><br></div><div>}  else {</div><div><br></div><div>

ds_select_dst(<span class="gmail-pl-s"><span class="gmail-pl-pds">"</span>2<span class="gmail-pl-pds">"</span></span>, <span class="gmail-pl-s"><span class="gmail-pl-pds">"</span>4<span class="gmail-pl-pds">"</span></span>)



</div><div><br></div><div>}<br>

</div><div><br></div><div>I never tried this code, so it might have some errors, but you should understand the overall idea. <br></div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Jurijs<br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 25, 2020 at 9:18 AM Patrik Nilsson <<a href="mailto:patrik.n@pm.me">patrik.n@pm.me</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi,<br></div><div><br></div><div>Although what I'm trying to achieve seems like an easy task, I have been tearing my hair for the past two days getting Kamailio to dispatch incoming phone calls to two different groups of Asterisk servers in my dispatcher list. I have 30 dedicated phone numbers from Telco: 020131600 - 020131629. I want 00-19 to be routed to Group 1, and 20-29 to be routed to Group 2, with a Round-robin algorithm. I'm aware that I can set up these incoming phone numbers in each Asterisk server's extension dial plans; nevertheless, I want Kamailio to do the initial incoming routing to a specific group (as Group 2, for instance, will never receive calls from for instance 02013161). </div><div><br></div><div>Example dispatcher.list:<br></div><div>#Company A (Group 1)<br></div><div>1 sip:10.50.0.1 0 0 maxload=20<br></div><div>1 sip:10.50.0.2 0 0 maxload=20<br></div><div>1 sip:10.50.0.3 0 0 maxload=20<br></div><div>#Company B (Group 2)<br></div><div>2 sip: 10.60.0.1 0 0 maxload=20<br></div><div>2 sip: 10.60.0.2 0 0 maxload=20<br></div><div>2 sip: 10.60.0.3 0 0 maxload=20<br></div><div><br></div><div>I assume this is done in the route[DISPATCH] of my kamailio.cfg, using ds_select_dst, but my previous attempts to get this routing to work just breaks the config file.<br></div><div><br></div><div>I appreciate any help that I can get!<br></div><div><br></div><div>Best regards,<br></div><div>Patrik<br></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>