Great! That worked<br><br><div class="gmail_quote">On Fri, Apr 9, 2010 at 11:01 PM, Carsten Bock <span dir="ltr">&lt;<a href="mailto:lists@bock.info">lists@bock.info</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<div><br></div><div>your problem is, that you are using round robin for registration (method 4).</div><div>The system creates a nonce value and validates this. Normally, only the system which generated the nonce can validate it (this should apply for the Asterisk, in the Kamailio Authentication you may configure this, <a href="http://kamailio.org/docs/modules/1.5.x/auth.html#id2510477" target="_blank">http://kamailio.org/docs/modules/1.5.x/auth.html#id2510477</a>). So we have to make sure, that both the original INVITE/REGISTER and the following INVITE/REGISTER reach the same server.</div>


<div><br></div><div>In your case, you should use a different algorithm (Please see <a href="http://kamailio.org/docs/modules/1.5.x/dispatcher.html#id2468101" target="_blank">http://kamailio.org/docs/modules/1.5.x/dispatcher.html#id2468101</a>).</div>


<div>Probably algorhitm &quot;0&quot; would be best for you (Hash over Call-ID). For your requests you should replace &quot; ds_select_dst(&quot;1&quot;,&quot;4&quot;);&quot; with &quot; ds_select_dst(&quot;1&quot;,&quot;0&quot;);&quot; and your authentication should work.</div>


<div><br></div><div>Carsten</div><div><br></div><div><div class="gmail_quote">2010/4/9 Vic Jolin <span dir="ltr">&lt;<a href="mailto:victor.jolin@gmail.com" target="_blank">victor.jolin@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">

I just noticed that if I have 4 servers set like this<br><br># group  sip addresses of your * units<br>1 sip:XXX.XXX.XXX.XXX:5060<br>1 sip:XXX.XXX.XXX.XXX:5060<br>1 sip:XXX.XXX.XXX.XXX:5060<br>1 sip:XXX.XXX.XXX.XXX:5060<br>



<br>the registration does not work and I get 401 unauthorized.<br><br><br>My setup is like this<br><br>Openser as proxy sends all SIP messages to load balanced asterisk servers<br>So sip phones should be able to register to the asterisk server <br>



<br>The routing part in kamailio.cfg looks like this<br><br>if ( method==&quot;REGISTER&quot; || method==&quot;NOTIFY&quot; || method==&quot;OPTIONS&quot; || method==&quot;ACK&quot; || method==&quot;MESSAGE&quot;) {<br>        fix_nated_contact();<br>



        fix_nated_register();<br>        ds_select_dst(&quot;1&quot;,&quot;4&quot;);<br>        forward();#uri:host, uri:port);<br>        exit();<br><br>}<br><br>if (method==&quot;BYE&quot; || method==&quot;CANCEL&quot;) {<br>



        unforce_rtp_proxy();<br>} else if (method==&quot;INVITE&quot;){<br>        log(&quot;VCTOR: Got an invite\n&quot;);<br>        fix_nated_contact();<br>        force_rtp_proxy();<br>        ds_select_dst(&quot;1&quot;,&quot;4&quot;);<br>



        forward();#uri:host, uri:port);<br>        t_on_failure(&quot;1&quot;);<br>};<br><br>        search_append(&#39;Contact:.*sip:[^&gt;[:cntrl:]]*&#39;, &#39;;nat=yes&#39;);<br><br>t_on_reply(&quot;1&quot;);<br><br>


<br>
if (!is_method(&quot;INVITE|REGISTER|MESSAGE|BYE|NOTIFY|ACK|CANCEL|REFER|SUBSCRIBE|OPTIONS|INFO&quot;)) {<br>xlog(&quot;L_INFO&quot;, &quot;=== [$rm] Method Not Implement ===========\n&quot;);<br><br>sl_send_reply(&quot;501&quot;, &quot;Not implemented here&quot;);<br>



return;<br>};<br><br><br>any thoughts?<br>
<br></div></div>_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Carsten Bock<br>


Schomburgstr. 80<br>22767 Hamburg<br>Germany<br><br>Mobile +49 179 2021244<br>Home +49 40 34927217<br>Fax +49 40 34927218<br>mailto:<a href="mailto:carsten@bock.info" target="_blank">carsten@bock.info</a><br><br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Vic Jolin<br>MyPhotoblog | <a href="http://www.pinoyclicks.net">http://www.pinoyclicks.net</a><br>