<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Dear Friends,<div><br></div><div>With Kamailio 3.1.2, after successfully registering, the caller sends INVITE to the proxy, and is always responded with 403 not relaying.</div><div><br></div><div>I found that in the&nbsp;route[AUTH] subroutine, like below. Regarding the red comparing, it failed. I also check the code, and found Kamailio will use the host name in the From header to compare all the socket's IP address, such as host = mysipserver.com, but socket's ip = 127.0.0.1 or 10.1.1.5. As you can see, this comparing will never be equal.</div><div>Could anyone show me how to handle this problem? Thanks a lot!</div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;# authenticate if from local subscriber</div><div>&nbsp;&nbsp; &nbsp; &nbsp; <font class="Apple-style-span" color="#FF0000">&nbsp;<b>if (from_uri==myself)</b></font></div><div>&nbsp;&nbsp;
 &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!proxy_authorize("$fd", "subscriber")) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_challenge("$fd", "0");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (is_method("PUBLISH"))</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ($au!=$tU) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sl_send_reply("403","Forbidden auth ID");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else
 {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ($au!=$fU) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sl_send_reply("403","Forbidden auth ID");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;consume_credentials();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# caller authenticated</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} else {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# caller is not local subscriber, then check if it calls</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# a local destination, otherwise deny, not an open relay here</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 <font class="Apple-style-span" color="#0000FF">&nbsp;<b>if (!uri==myself)</b></font></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sl_send_reply("403","Not relaying");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></div><div><br></div><div>Best Regards,</div><div>Spencer</div></td></tr></table><br>