[SR-Users] Problem with www_challenge

Stoyan Mihaylov stoyan.v.mihaylov at gmail.com
Mon Jan 23 16:06:48 CET 2012


Hi,
If I am using IP address, I have no problems. If I use domain name
(pointing to same IP address) then phones do not register.
I have couple of hardware and software SIP phones and when I put name of
domain (stribogkonsult.com) - then no registration, if I put IP - no
problems.
I put IP, and names in domain table.
Effect is - when I use domain name, there are bulk of messages in syslog -
like messages reenter kamailio again and again.
xlog("Auth attemps $au\n"); - I receive many times if I use domain name, if
I use IP - once only.

Problem can be somewhere else of course. But everything else work as I
expect.


route[AUTH] {
#!ifdef WITH_AUTH
if (is_method("REGISTER"))
{
if (!www_authorize("$td", "subscriber"))
{
xlog("RegisterChalange $au $td\n");
www_challenge("$td", "1");
exit;
}
if ($au!=$tU)
{
sl_send_reply("403","Forbidden auth ID");
exit;
}
xlog("Auth attemps $au\n");
} else {

#!ifdef WITH_IPAUTH
if(allow_source_address())
{
# source IP allowed
return;
}
#!endif

# authenticate if from local subscriber
if (from_uri==myself)
{
xlog("Register MySelf\n");
if (!proxy_authorize("$fd", "subscriber")) {
proxy_challenge("$fd", "0");
exit;
}
if (is_method("PUBLISH"))
{
if ($au!=$fU || $au!=$tU) {
sl_send_reply("403","Forbidden auth ID");
exit;
}
if ($au!=$rU) {
sl_send_reply("403","Forbidden R-URI");
exit;
}
} else {
if ($au!=$fU) {
sl_send_reply("403","Forbidden auth ID");
exit;
}
}

consume_credentials();
# caller authenticated
} else {
# caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if (!uri==myself)
{
sl_send_reply("403","Not relaying");
exit;
}
}
}
#!endif
return;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120123/64e7452c/attachment-0001.htm>


More information about the sr-users mailing list