<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello,<br>
</p>
<br>
<div class="moz-cite-prefix">On 13.06.17 14:35, Marko Tirs wrote:<br>
</div>
<blockquote
cite="mid:1520338313.8293613.1497357322081@mail.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:16px">
<div id="yui_3_16_0_1_1497342755482_7382">Hi all,</div>
<div id="yui_3_16_0_1_1497342755482_7381"><br>
</div>
<div id="yui_3_16_0_1_1497342755482_7380">I have here:</div>
<div id="yui_3_16_0_1_1497342755482_7379">Kamailio 1:
192.168.0.11</div>
<div id="yui_3_16_0_1_1497342755482_7353">Kamailio 2:
192.168.0.21</div>
<div id="yui_3_16_0_1_1497342755482_7362">Asterisk 1:
192.168.0.12</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7363"><br
id="yui_3_16_0_1_1497342755482_7364">
</div>
<div id="yui_3_16_0_1_1497342755482_7270" dir="ltr">Asterisk1 is
registered on Kamailio1 as User 100. Asterisk1 shouldn't be
registered on Kamailio2.<br>
</div>
<div id="yui_3_16_0_1_1497342755482_7425"><br>
</div>
<div id="yui_3_16_0_1_1497342755482_7487">User 111 registered on
Kamailio1</div>
User 211 registered on Kamailio2
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8344">User 121
registered on Asterisk1</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8345"><br>
</div>
<div id="yui_3_16_0_1_1497342755482_8342">Test cases:</div>
<div id="yui_3_16_0_1_1497342755482_8360">---------------------</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8341">111 calls
211 - OK</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8225">211 calls
111 - OK</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8234">121 calls
111 - OK</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8243">121 calls
211 - Kamailio1 doesn't forward INVITE to Kamailio2, Asterisk
gets 'Busy' !?</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8499"><br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8490"><br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8404">Is the
approach just to replace destination IP-address in $ru,
depending from 1st digit, right?</div>
</div>
</blockquote>
<br>
yes, if you partitioned the users and you know by first digit where
it should be registered, then all is fine -- update the r-uri and
then you can relay to the other server.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote
cite="mid:1520338313.8293613.1497357322081@mail.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:16px">
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8461"><br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8542">If not, what
is the right approach to reach the remote users from Asterisk,
which are registered on remote Kamailio and not on the local
Kamailio?</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8491"><br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8543">Thank you</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8602">Regards</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8603">Marko<br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8405"><br>
</div>
<div id="yui_3_16_0_1_1497342755482_8331"><br>
</div>
My changes in kamailio.cfg in both kamailios (based on
kamailio-basic.cfg) :
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8055">--------------------------------------------------------------------------------------------------------------</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7947">kamailio1.bindip
= "192.168.0.11"<br id="yui_3_16_0_1_1497342755482_7952">
kamailio2.bindip = "192.168.0.21"<br
id="yui_3_16_0_1_1497342755482_7953">
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8035">...</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8094">route {<br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8034"> if
(is_method("INVITE")) {<br
id="yui_3_16_0_1_1497342755482_8144">
if($rU=~"^1[0-9][0-9]$") {<br
id="yui_3_16_0_1_1497342755482_8022">
$ru = "sip:" + $rU + "@" +
$sel(cfg_get.kamailio1.bindip) + ":5060";<br
id="yui_3_16_0_1_1497342755482_8024">
}<br id="yui_3_16_0_1_1497342755482_8027">
else if($rU=~"^2[0-9][0-9]$") {<br
id="yui_3_16_0_1_1497342755482_8028">
$ru = "sip:" + $rU + "@" +
$sel(cfg_get.kamailio2.bindip) + ":5060";<br
id="yui_3_16_0_1_1497342755482_8030">
}</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8160"> }<br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_8152">...<br>
</div>
<div id="yui_3_16_0_1_1497342755482_7943"><br>
</div>
<div id="yui_3_16_0_1_1497342755482_7486" dir="ltr">sip.conf in
Asterisk1:</div>
<div id="yui_3_16_0_1_1497342755482_7816">----------------------------------<br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7469">register
=> <a class="moz-txt-link-abbreviated" href="mailto:100:abc@192.168.0.124:5060/100">100:abc@192.168.0.124:5060/100</a><br
id="yui_3_16_0_1_1497342755482_7740">
<br id="yui_3_16_0_1_1497342755482_7741">
[100]<br id="yui_3_16_0_1_1497342755482_7742">
type=friend<br id="yui_3_16_0_1_1497342755482_7744">
host=192.168.0.11<br id="yui_3_16_0_1_1497342755482_7746">
secret=abc<br id="yui_3_16_0_1_1497342755482_7748">
context=kamailio<br id="yui_3_16_0_1_1497342755482_7754">
<br id="yui_3_16_0_1_1497342755482_7755">
[121]<br id="yui_3_16_0_1_1497342755482_7756">
type=friend<br id="yui_3_16_0_1_1497342755482_7757">
secret=abc<br id="yui_3_16_0_1_1497342755482_7758">
host=dynamic<br id="yui_3_16_0_1_1497342755482_7759">
context=kamailio<br id="yui_3_16_0_1_1497342755482_7761">
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7808"><br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7852">extensions.conf</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7853">-------------------------------</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7854">[kamailio]<br
id="yui_3_16_0_1_1497342755482_7878">
exten => _[1-4]XX,1,Dial(SIP/100/${EXTEN},30)<br
id="yui_3_16_0_1_1497342755482_7882">
exten => _[1-4]XX,n,Hangup()<br
id="yui_3_16_0_1_1497342755482_7883">
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7891"><br>
</div>
<div dir="ltr" id="yui_3_16_0_1_1497342755482_7899"><br
id="yui_3_16_0_1_1497342755482_7470">
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>