[SR-Users] In kamailio.log not print log message

Daniel Tryba d.tryba at pocos.nl
Mon Mar 7 17:20:15 CET 2016


On Mon, Mar 07, 2016 at 09:13:05PM +0530, Shiv Patidar wrote:
> user registration is  done successfully but in /var/log/kamailio.log is not
> print log messages

Kamailio doesn't log this kind of message unless you tell it to.

Assuming you have the "default" config:
=======================================================================
# IP authorization and user authentication
route[AUTH] {
#!ifdef WITH_AUTH

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

        if (is_method("REGISTER") || from_uri==myself)
        {
                # authenticate requests
                if (!auth_check("$fd", "subscriber", "1")) {
                        auth_challenge("$fd", "0");
                        exit;
                }
                # user authenticated - remove auth header
                if(!is_method("REGISTER|PUBLISH"))
                        consume_credentials();
        }
        # if caller is not local subscriber, then check if it calls
        # a local destination, otherwise deny, not an open relay here
        if (from_uri!=myself && uri!=myself) {
                sl_send_reply("403","Not relaying");
                exit;
        }

#!endif
        return;
}
=======================================================================
You'll need to add an xlog statement http://kamailio.org/docs/modules/stable/modules/xlog.html#xlog.f.xlog
when auth_check is true.

if(!auth_check...) {
}
else{
   xlog("Authenticated: $au");
}



More information about the sr-users mailing list