<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 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> # authenticate if from local subscriber</div><div> <font class="Apple-style-span" color="#FF0000"> <b>if (from_uri==myself)</b></font></div><div>
{</div><div> if (!proxy_authorize("$fd", "subscriber")) {</div><div> proxy_challenge("$fd", "0");</div><div> exit;</div><div> }</div><div> if (is_method("PUBLISH"))</div><div> {</div><div> if ($au!=$tU) {</div><div> sl_send_reply("403","Forbidden auth ID");</div><div> exit;</div><div> }</div><div> } else
{</div><div> if ($au!=$fU) {</div><div> sl_send_reply("403","Forbidden auth ID");</div><div> exit;</div><div> }</div><div> }</div><div> </div><div> consume_credentials();</div><div> # caller authenticated</div><div> } else {</div><div> # caller is not local subscriber, then check if it calls</div><div> # a local destination, otherwise deny, not an open relay here</div><div>
<font class="Apple-style-span" color="#0000FF"> <b>if (!uri==myself)</b></font></div><div> {</div><div> sl_send_reply("403","Not relaying");</div><div> exit;</div><div> }</div><div> }</div></div><div><br></div><div>Best Regards,</div><div>Spencer</div></td></tr></table><br>