[SR-Users] In kamailio.log not print log message
Shiv Patidar
patidarshiv3 at gmail.com
Mon Mar 7 18:48:17 CET 2016
thank you for help
i am new and i don't have brief knowledge
so please tell me where i add this code
and please explain in brief
# 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;
}
On Mon, Mar 7, 2016 at 9:50 PM, Daniel Tryba <d.tryba at pocos.nl> wrote:
> 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");
> }
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160307/828038b8/attachment.html>
More information about the sr-users
mailing list