<html><head></head><body><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_1497554948605_2897">Hello Daniel,</div><div id="yui_3_16_0_1_1497554948605_2884" dir="ltr"><br></div><div dir="ltr" id="yui_3_16_0_1_1497554948605_3210">> 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 id="yui_3_16_0_1_1497554948605_2951" clear="none">
</div><div id="yui_3_16_0_1_1497554948605_2883"><span id="yui_3_16_0_1_1497554948605_3326"><br></span></div><div id="yui_3_16_0_1_1497554948605_2989" dir="ltr"><span id="yui_3_16_0_1_1497554948605_3435">I do it (update the $ur with the right destination IP) for all calls (INVITEs). If a SIP client registered on Kamailio1 calls a client registered on Kamailio2 then it functions. If an other client calls through an Asterisk (which is registered on Kamailio) then it doesn't function! </span>Kamailio1 doesn't forward INVITE to Kamailio2, Asterisk
gets 'Busy'!</div><div dir="ltr" id="yui_3_16_0_1_1497554948605_3809"><span id="yui_3_16_0_1_1497554948605_3003">Please see my test cases bellow: 3 of them function, 1 of them doesn't function!<br></span></div><div dir="ltr" id="yui_3_16_0_1_1497554948605_3097"><span id="yui_3_16_0_1_1497554948605_3003"><br></span></div><div dir="ltr" id="yui_3_16_0_1_1497554948605_3212"><span id="yui_3_16_0_1_1497554948605_3003">Asterisk obviously doesn't send some part of the INVITE message which is needed to call another Kamailio.<br></span></div><div id="yui_3_16_0_1_1497554948605_2988"><span><br></span></div><div id="yui_3_16_0_1_1497554948605_3398"><span id="yui_3_16_0_1_1497554948605_3397">Can you give me some advise how to solve it? Which other variable should be set to relay the INVITE to the 2nd Kamailio?<br></span></div><div id="yui_3_16_0_1_1497554948605_3209"><span><br></span></div><div id="yui_3_16_0_1_1497554948605_3211"><span id="yui_3_16_0_1_1497554948605_3660">Thank you</span></div><div id="yui_3_16_0_1_1497554948605_3658"><span>Regards</span></div><div id="yui_3_16_0_1_1497554948605_3661"><span>Marko<br></span></div><div id="yui_3_16_0_1_1497554948605_2986"><span></span></div><div class="qtdSeparateBR" id="yui_3_16_0_1_1497554948605_2882"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_1_1497554948605_2856" style="display: block;"> <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1497554948605_2855"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1497554948605_2854"> <div dir="ltr" id="yui_3_16_0_1_1497554948605_2853"> <font id="yui_3_16_0_1_1497554948605_2852" face="Arial" size="2"> <hr id="yui_3_16_0_1_1497554948605_2985" size="1"> <b><span style="font-weight:bold;">From:</span></b> Daniel-Constantin Mierla <miconda@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Marko Tirs <marko.tirs@yahoo.com>; Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, June 14, 2017 10:43 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [SR-Users] Kamailio+Asterisk - Kamailio doesn't forward INVITE to 2nd Kamailio<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1497554948605_2932"><br><div id="yiv2657871918"><div id="yui_3_16_0_1_1497554948605_2931">
<div id="yui_3_16_0_1_1497554948605_3707">Hello,<br clear="none">
</div>
<br clear="none">
<div class="yiv2657871918moz-cite-prefix" id="yui_3_16_0_1_1497554948605_3708">On 13.06.17 14:35, Marko Tirs wrote:<br clear="none">
</div>
<blockquote type="cite" id="yui_3_16_0_1_1497554948605_2930">
<div style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_1_1497554948605_2929">
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7382">Hi all,</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7381"><br clear="none">
</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7380">I have here:</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7379">Kamailio 1:
192.168.0.11</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7353">Kamailio 2:
192.168.0.21</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7362">Asterisk 1:
192.168.0.12</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7363"><br id="yiv2657871918yui_3_16_0_1_1497342755482_7364" clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7270">Asterisk1 is
registered on Kamailio1 as User 100. Asterisk1 shouldn't be
registered on Kamailio2.<br clear="none">
</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7425"><br clear="none">
</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7487">User 111 registered on
Kamailio1</div>
User 211 registered on Kamailio2
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8344">User 121
registered on Asterisk1</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8345"><br clear="none">
</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_8342">Test cases:</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_8360">---------------------</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8341">111 calls
211 - OK</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8225">211 calls
111 - OK</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8234">121 calls
111 - OK</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8243">121 calls
211 - Kamailio1 doesn't forward INVITE to Kamailio2, Asterisk
gets 'Busy' !?</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8499"><br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8490"><br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_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 clear="none">
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 clear="none">
<br clear="none">
Cheers,<br clear="none">
Daniel<div class="yiv2657871918yqt4135814323" id="yiv2657871918yqtfd92310"><br clear="none">
<br clear="none">
</div><blockquote type="cite" id="yui_3_16_0_1_1497554948605_2935"><div class="yiv2657871918yqt4135814323" id="yiv2657871918yqtfd78701">
</div><div style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_1_1497554948605_2934"><div class="yiv2657871918yqt4135814323" id="yiv2657871918yqtfd67463">
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8461"><br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_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="yiv2657871918yui_3_16_0_1_1497342755482_8491"><br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8543">Thank you</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8602">Regards</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8603">Marko<br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8405"><br clear="none">
</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_8331"><br clear="none">
</div>
My changes in kamailio.cfg in both kamailios (based on
kamailio-basic.cfg) :
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8055">--------------------------------------------------------------------------------------------------------------</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7947">kamailio1.bindip
= "192.168.0.11"<br id="yiv2657871918yui_3_16_0_1_1497342755482_7952" clear="none">
kamailio2.bindip = "192.168.0.21"<br id="yiv2657871918yui_3_16_0_1_1497342755482_7953" clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8035">...</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8094">route {<br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8034"> if
(is_method("INVITE")) {<br id="yiv2657871918yui_3_16_0_1_1497342755482_8144" clear="none">
if($rU=~"^1[0-9][0-9]$") {<br id="yiv2657871918yui_3_16_0_1_1497342755482_8022" clear="none">
$ru = "sip:" + $rU + "@" +
$sel(cfg_get.kamailio1.bindip) + ":5060";<br id="yiv2657871918yui_3_16_0_1_1497342755482_8024" clear="none">
}<br id="yiv2657871918yui_3_16_0_1_1497342755482_8027" clear="none">
else if($rU=~"^2[0-9][0-9]$") {<br id="yiv2657871918yui_3_16_0_1_1497342755482_8028" clear="none">
$ru = "sip:" + $rU + "@" +
$sel(cfg_get.kamailio2.bindip) + ":5060";<br id="yiv2657871918yui_3_16_0_1_1497342755482_8030" clear="none">
}</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8160"> }<br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_8152">...<br clear="none">
</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7943"><br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7486">sip.conf in
Asterisk1:</div>
<div id="yiv2657871918yui_3_16_0_1_1497342755482_7816">----------------------------------<br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7469">register
=> <a rel="nofollow" shape="rect" class="yiv2657871918moz-txt-link-abbreviated" ymailto="mailto:100:abc@192.168.0.124:5060/100" target="_blank" href="mailto:100:abc@192.168.0.124:5060/100">100:abc@192.168.0.124:5060/100</a><br id="yiv2657871918yui_3_16_0_1_1497342755482_7740" clear="none">
<br id="yiv2657871918yui_3_16_0_1_1497342755482_7741" clear="none">
[100]<br id="yiv2657871918yui_3_16_0_1_1497342755482_7742" clear="none">
type=friend<br id="yiv2657871918yui_3_16_0_1_1497342755482_7744" clear="none">
host=192.168.0.11<br id="yiv2657871918yui_3_16_0_1_1497342755482_7746" clear="none">
secret=abc<br id="yiv2657871918yui_3_16_0_1_1497342755482_7748" clear="none">
context=kamailio<br id="yiv2657871918yui_3_16_0_1_1497342755482_7754" clear="none">
<br id="yiv2657871918yui_3_16_0_1_1497342755482_7755" clear="none">
[121]<br id="yiv2657871918yui_3_16_0_1_1497342755482_7756" clear="none">
type=friend<br id="yiv2657871918yui_3_16_0_1_1497342755482_7757" clear="none">
secret=abc<br id="yiv2657871918yui_3_16_0_1_1497342755482_7758" clear="none">
host=dynamic<br id="yiv2657871918yui_3_16_0_1_1497342755482_7759" clear="none">
context=kamailio<br id="yiv2657871918yui_3_16_0_1_1497342755482_7761" clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7808"><br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7852">extensions.conf</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7853">-------------------------------</div>
</div><div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7854"><div class="yiv2657871918yqt4135814323" id="yiv2657871918yqtfd94197">[kamailio]<br id="yiv2657871918yui_3_16_0_1_1497342755482_7878" clear="none">
exten => _[1-4]XX,1,Dial(SIP/100/${EXTEN},30)<br id="yiv2657871918yui_3_16_0_1_1497342755482_7882" clear="none">
exten => _[1-4]XX,n,Hangup()</div><br id="yiv2657871918yui_3_16_0_1_1497342755482_7883" clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7891"><br clear="none">
</div>
<div dir="ltr" id="yiv2657871918yui_3_16_0_1_1497342755482_7899"><br id="yiv2657871918yui_3_16_0_1_1497342755482_7470" clear="none">
</div>
</div>
<br clear="none">
<fieldset class="yiv2657871918mimeAttachmentHeader"></fieldset>
<br clear="none">
<pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a rel="nofollow" shape="rect" class="yiv2657871918moz-txt-link-abbreviated" ymailto="mailto:sr-users@lists.kamailio.org" target="_blank" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a rel="nofollow" shape="rect" class="yiv2657871918moz-txt-link-freetext" target="_blank" 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 clear="none">
<pre class="yiv2657871918moz-signature">--
Daniel-Constantin Mierla
<a rel="nofollow" shape="rect" class="yiv2657871918moz-txt-link-abbreviated" target="_blank" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a rel="nofollow" shape="rect" class="yiv2657871918moz-txt-link-abbreviated" target="_blank" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a rel="nofollow" shape="rect" class="yiv2657871918moz-txt-link-abbreviated" target="_blank" href="http://www.asipto.com/">www.asipto.com</a>
Kamailio World Conference - <a rel="nofollow" shape="rect" class="yiv2657871918moz-txt-link-abbreviated" target="_blank" href="http://www.kamailioworld.com/">www.kamailioworld.com</a></pre><div class="yiv2657871918yqt4135814323" id="yiv2657871918yqtfd73973">
</div></div></div><br><br></div> </div> </div> </div></div></body></html>