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">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">http://kamailio.org/docs/modules/1.5.x/dispatcher.html#id2468101</a>).</div>
<div>Probably algorhitm "0" would be best for you (Hash over Call-ID). For your requests you should replace " ds_select_dst("1","4");" with " ds_select_dst("1","0");" 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"><<a href="mailto:victor.jolin@gmail.com">victor.jolin@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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=="REGISTER" || method=="NOTIFY" || method=="OPTIONS" || method=="ACK" || method=="MESSAGE") {<br> fix_nated_contact();<br>
fix_nated_register();<br> ds_select_dst("1","4");<br> forward();#uri:host, uri:port);<br> exit();<br><br>}<br><br>if (method=="BYE" || method=="CANCEL") {<br>
unforce_rtp_proxy();<br>} else if (method=="INVITE"){<br> log("VCTOR: Got an invite\n");<br> fix_nated_contact();<br> force_rtp_proxy();<br> ds_select_dst("1","4");<br>
forward();#uri:host, uri:port);<br> t_on_failure("1");<br>};<br><br> search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');<br><br>t_on_reply("1");<br><br>
<br>
if (!is_method("INVITE|REGISTER|MESSAGE|BYE|NOTIFY|ACK|CANCEL|REFER|SUBSCRIBE|OPTIONS|INFO")) {<br>xlog("L_INFO", "=== [$rm] Method Not Implement ===========\n");<br><br>sl_send_reply("501", "Not implemented here");<br>
return;<br>};<br><br><br>any thoughts?<br>
<br>_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org">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">carsten@bock.info</a><br><br>
</div>