Re: [SR-Users] Logging from cfg file

2019-01-14 Thread Denys Pozniak
Now it works!
Thanks!

пн, 14 янв. 2019 г. в 12:47, Daniel-Constantin Mierla :

> Hello,
>
> have you loaded corex module?
>
> Cheers,
> Daniel
> On 14.01.19 10:40, Denys Pozniak wrote:
>
> Hello!
> Tried to use $cfg(line), but got error.
> Please point me where the issue is.
>
> loadmodule "cfgutils.so"
> xlog("L_WARNING", "route block: $cfg(line) \n");
>
> Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/pvapi.c:903]:
> pv_parse_spec2(): error searching pvar "cfg"
> Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/pvapi.c:1107]:
> pv_parse_spec2(): wrong char [l/108] in [$cfg(line)] at [5 (5)]
> Jan 14 10:39:19 dev kamailio[10856]: ERROR: xlog [xlog.c:513]:
> xdbg_fixup_helper(): wrong format[pvar $cfg(line) #012]
> Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/route.c:1154]:
> fix_actions(): fixing failed (code=-1) at
> cfg:/etc/kamailio/routing.d/main.cfg:8
>
> # kamailio -v
> version: kamailio 5.1.6 (x86_64/linux)
>
>
>
> вс, 30 дек. 2018 г. в 05:19, Joel Serrano :
>
>> Adding it to my log_prefix !!!
>>
>> Sounds dum but this simplifies my logging so much 
>>
>> Thanks guys, every day you learn something new!
>>
>>
>> On Sat, Dec 29, 2018 at 14:42 David Villasmil <
>> david.villasmil.w...@gmail.com> wrote:
>>
>>> yep: $cfg(route)
>>> added Jun 2017
>>> Regards,
>>>
>>> David Villasmil
>>> email: david.villasmil.w...@gmail.com
>>> phone: +34669448337
>>>
>>>
>>> On Sat, Dec 29, 2018 at 10:09 PM * Paolo Visintin - evosip.cloud
>>>   wrote:
>>>
 Joel , you could use $cfg(route) !

 I usually store my breadcrumbs in a define and use on top of every
 interesting route !


 Il giorno sab 29 dic 2018 alle 21:29 Joel Serrano 
 ha scritto:

> I wonder if there is a $something that contains the route-block-name?
>
> Anyone know?
>
>
> On Sat, Dec 29, 2018 at 10:52 David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> I prefer using
>>
>> log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register Request\n”);
>>
>> That way you have the route block where you are logging from and the
>> Call-ID with your information string. (I mostly use L_ERR when debugging)
>>
>> Cheers
>> On Sat, 29 Dec 2018 at 11:02, Mojtaba  wrote:
>>
>>> Hi,
>>> You could use xlog instead of log, like this:
>>>  xlog("Register request...\n");
>>> With Regards.Mojtaba
>>>
>>> On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
>>>  wrote:
>>> >
>>> > Hi everyone,
>>> >
>>> > I have recently started working on Kamailio, I am trying to learn
>>> the basics. For "Register" route, I am trying to print the log but log 
>>> is
>>> not appearing in log file. Other logs are there, only this one is 
>>> missing.
>>> >
>>> > if(is_method("REGISTER")){
>>> >  log(2, "Register request");
>>> > }
>>> >
>>> > I will be really helpful if you can help me with this.
>>> >
>>> > Thanks & Kind Regards
>>> >
>>> > Regards,
>>> > M.Allaudin
>>> > Software Engineer
>>> > Nowtel Group
>>> > Phone # +92-333-8291874
>>> > Blogger @ allaudin.github.io
>>> > ___
>>> > Kamailio (SER) - Users Mailing List
>>> > sr-users@lists.kamailio.org
>>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>>
>>> --
>>> --Mojtaba Esfandiari.S
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
 --
 *Paolo Visintin*
 *CTO*
 evosip.cloud
 [image: Risultati immagini per evosip]
 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
> --
>
> BR,
> Denys Pozniak
>
>
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> 

Re: [SR-Users] Logging from cfg file

2019-01-14 Thread Daniel-Constantin Mierla
Hello,

have you loaded corex module?

Cheers,
Daniel

On 14.01.19 10:40, Denys Pozniak wrote:
> Hello!
> Tried to use $cfg(line), but got error.
> Please point me where the issue is.
>
> loadmodule "cfgutils.so"
> xlog("L_WARNING", "route block: $cfg(line) \n");
>
> Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/pvapi.c:903]:
> pv_parse_spec2(): error searching pvar "cfg"
> Jan 14 10:39:19 dev kamailio[10856]: ERROR: 
> [core/pvapi.c:1107]: pv_parse_spec2(): wrong char [l/108] in
> [$cfg(line)] at [5 (5)]
> Jan 14 10:39:19 dev kamailio[10856]: ERROR: xlog [xlog.c:513]:
> xdbg_fixup_helper(): wrong format[pvar $cfg(line) #012]
> Jan 14 10:39:19 dev kamailio[10856]: ERROR: 
> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at
> cfg:/etc/kamailio/routing.d/main.cfg:8
>
> # kamailio -v
> version: kamailio 5.1.6 (x86_64/linux)
>
>
>
> вс, 30 дек. 2018 г. в 05:19, Joel Serrano  >:
>
> Adding it to my log_prefix !!!
>
> Sounds dum but this simplifies my logging so much 
>
> Thanks guys, every day you learn something new! 
>
>
> On Sat, Dec 29, 2018 at 14:42 David Villasmil
>  > wrote:
>
> yep: $cfg(route)
> added Jun 2017
> Regards,
>
> David Villasmil
> email: david.villasmil.w...@gmail.com
> 
> phone: +34669448337
>
>
> On Sat, Dec 29, 2018 at 10:09 PM * Paolo Visintin -
> evosip.cloud  wrote:
>
> Joel , you could use $cfg(route) !
>
> I usually store my breadcrumbs in a define and use on top
> of every interesting route ! 
>
>
> Il giorno sab 29 dic 2018 alle 21:29 Joel Serrano
> mailto:j...@textplus.com>> ha scritto:
>
> I wonder if there is a $something that contains the
> route-block-name?
>
> Anyone know?
>
>
> On Sat, Dec 29, 2018 at 10:52 David Villasmil
>  > wrote:
>
> I prefer using
>
> log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register
> Request\n”);
>
> That way you have the route block where you are
> logging from and the Call-ID with your information
> string. (I mostly use L_ERR when debugging)
>
> Cheers
> On Sat, 29 Dec 2018 at 11:02, Mojtaba
> mailto:mes...@gmail.com>> wrote:
>
> Hi,
> You could use xlog instead of log, like this:
>  xlog("Register request...\n");
> With Regards.Mojtaba
>
> On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
>  > wrote:
> >
> > Hi everyone,
> >
> > I have recently started working on Kamailio,
> I am trying to learn the basics. For
> "Register" route, I am trying to print the log
> but log is not appearing in log file. Other
> logs are there, only this one is missing.
> >
> > if(is_method("REGISTER")){
> >  log(2, "Register request");
> > }
> >
> > I will be really helpful if you can help me
> with this.
> >
> > Thanks & Kind Regards
> >
> > Regards,
> > M.Allaudin
> > Software Engineer
> > Nowtel Group
> > Phone # +92-333-8291874
> > Blogger @ allaudin.github.io
> 
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> 
> >
> 
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> -- 
> --Mojtaba Esfandiari.S
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> 
> 
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>

Re: [SR-Users] Logging from cfg file

2019-01-14 Thread Alex
request_route {
$avp(sess_mylog_id) = 0;

$var(mylog_data) = 'L_INFO|route[MAIN] INIT SIP REQUEST [ sip_requestId:' +
$mi + ' ]';
route(MYLOG);

.

}

route[MYLOG] {

$avp(sess_mylog_id) = $avp(sess_mylog_id) + 1;
$shv(mylog_id) = $shv(mylog_id) + 1;

$var(mylog_level) = $(var(mylog_data){s.select,0,|});
$var(mylog_msg) = $(var(mylog_data){s.select,1,|});

#xlog("L_INFO","route[MYLOG] mylog_data = [$var(mylog_data)]
n=$var(n)");

#if ( $var(mylog_data) ) {
#   $var(mylog_level) = $(var(mylog_data){s.select,0,,});
#   $var(mylog_msg) = $(var(mylog_data){s.select,1,,});
#}

$var(direct) = 'unknown';
if ( is_request() ) {
$var(direct) = 'request';
}
if ( is_reply() ) {
$var(direct) = 'reply';
}

# 
# si - client source ip
# sp - client source port
# Ri - destination ip
# --
# ad - is always null
# rU - is always null
# 

$var(mylog_out) = '[MYLOG][' + $shv(mylog_id) + '][' +
$avp(sess_mylog_id) + '] => ' + $var(mylog_msg) +
" # direct=" + $var(direct) +
" rm=" + $rm +
" fu=" + $fu + " fU=" + $fU + " fd=" + $fd + " ft=" + $ft +
" tU=" + $tU + " tt=" + $tt +
" rd=" + $rd +
" au=" + $au + " aU=" + $aU + " Au=" + $Au +
" si=" + $si + " sp=" + $sp +
" Ri=" + $Ri +
" mi=" + $mi + " ci=" + $ci+ " cs=" + $cs + " ua=[" + $ua + "]";

#xlog('L_INFO',"route[MYLOG] level=$var(mylog_level)
msg=$var(mylog_msg)\n");

switch ( $var(mylog_level) ) {
case 'L_ALERT':
xlog('L_ALERT',"$var(mylog_out)\n");
break;
case 'L_DEBUG':
xlog('L_DEBUG',"$var(mylog_out)\n");
break;
case 'L_ERROR':
xlog('L_ERROR',"$var(mylog_out)\n");
break;
case 'L_INFO':
xlog('L_INFO',"$var(mylog_out)\n");
break;
case 'L_NOTICE':
xlog('L_NOTICE',"$var(mylog_out)\n");
break;
case 'L_WARN':
xlog('L_WARN',"$var(mylog_out)\n");
break;
default:
xlog('L_ALERT',"[MYLOG] Unknown log_level=$var(mylog_level)
data=$var(mylog_data)\n");
}


$var(mylog_level) = '';
$var(mylog_msg) = '';
$var(mylog_out) = '';
$var(mylog_data) = '';
}


пн, 14 янв. 2019 г. в 12:42, Denys Pozniak :

> Hello!
> Tried to use $cfg(line), but got error.
> Please point me where the issue is.
>
> loadmodule "cfgutils.so"
> xlog("L_WARNING", "route block: $cfg(line) \n");
>
> Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/pvapi.c:903]:
> pv_parse_spec2(): error searching pvar "cfg"
> Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/pvapi.c:1107]:
> pv_parse_spec2(): wrong char [l/108] in [$cfg(line)] at [5 (5)]
> Jan 14 10:39:19 dev kamailio[10856]: ERROR: xlog [xlog.c:513]:
> xdbg_fixup_helper(): wrong format[pvar $cfg(line) #012]
> Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/route.c:1154]:
> fix_actions(): fixing failed (code=-1) at
> cfg:/etc/kamailio/routing.d/main.cfg:8
>
> # kamailio -v
> version: kamailio 5.1.6 (x86_64/linux)
>
>
>
> вс, 30 дек. 2018 г. в 05:19, Joel Serrano :
>
>> Adding it to my log_prefix !!!
>>
>> Sounds dum but this simplifies my logging so much 
>>
>> Thanks guys, every day you learn something new!
>>
>>
>> On Sat, Dec 29, 2018 at 14:42 David Villasmil <
>> david.villasmil.w...@gmail.com> wrote:
>>
>>> yep: $cfg(route)
>>> added Jun 2017
>>> Regards,
>>>
>>> David Villasmil
>>> email: david.villasmil.w...@gmail.com
>>> phone: +34669448337
>>>
>>>
>>> On Sat, Dec 29, 2018 at 10:09 PM * Paolo Visintin - evosip.cloud
>>>  wrote:
>>>
 Joel , you could use $cfg(route) !

 I usually store my breadcrumbs in a define and use on top of every
 interesting route !


 Il giorno sab 29 dic 2018 alle 21:29 Joel Serrano 
 ha scritto:

> I wonder if there is a $something that contains the route-block-name?
>
> Anyone know?
>
>
> On Sat, Dec 29, 2018 at 10:52 David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> I prefer using
>>
>> log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register Request\n”);
>>
>> That way you have the route block where you are logging from and the
>> Call-ID with your information string. (I mostly use L_ERR when debugging)
>>
>> Cheers
>> On Sat, 29 Dec 2018 at 11:02, Mojtaba  wrote:
>>
>>> Hi,
>>> You could use xlog instead of log, like this:
>>>  xlog("Register request...\n");
>>> With Regards.Mojtaba
>>>
>>> On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
>>>  wrote:
>>> >
>>> > Hi everyone,
>>> >
>>> > I have recently started working on Kamailio, I am trying to learn
>>> the basics. For "Register" route, I am trying to print the log but log 
>>> is
>>> not appearing in 

Re: [SR-Users] Logging from cfg file

2019-01-14 Thread Denys Pozniak
Hello!
Tried to use $cfg(line), but got error.
Please point me where the issue is.

loadmodule "cfgutils.so"
xlog("L_WARNING", "route block: $cfg(line) \n");

Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/pvapi.c:903]:
pv_parse_spec2(): error searching pvar "cfg"
Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/pvapi.c:1107]:
pv_parse_spec2(): wrong char [l/108] in [$cfg(line)] at [5 (5)]
Jan 14 10:39:19 dev kamailio[10856]: ERROR: xlog [xlog.c:513]:
xdbg_fixup_helper(): wrong format[pvar $cfg(line) #012]
Jan 14 10:39:19 dev kamailio[10856]: ERROR:  [core/route.c:1154]:
fix_actions(): fixing failed (code=-1) at
cfg:/etc/kamailio/routing.d/main.cfg:8

# kamailio -v
version: kamailio 5.1.6 (x86_64/linux)



вс, 30 дек. 2018 г. в 05:19, Joel Serrano :

> Adding it to my log_prefix !!!
>
> Sounds dum but this simplifies my logging so much 
>
> Thanks guys, every day you learn something new!
>
>
> On Sat, Dec 29, 2018 at 14:42 David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> yep: $cfg(route)
>> added Jun 2017
>> Regards,
>>
>> David Villasmil
>> email: david.villasmil.w...@gmail.com
>> phone: +34669448337
>>
>>
>> On Sat, Dec 29, 2018 at 10:09 PM * Paolo Visintin - evosip.cloud
>>  wrote:
>>
>>> Joel , you could use $cfg(route) !
>>>
>>> I usually store my breadcrumbs in a define and use on top of every
>>> interesting route !
>>>
>>>
>>> Il giorno sab 29 dic 2018 alle 21:29 Joel Serrano 
>>> ha scritto:
>>>
 I wonder if there is a $something that contains the route-block-name?

 Anyone know?


 On Sat, Dec 29, 2018 at 10:52 David Villasmil <
 david.villasmil.w...@gmail.com> wrote:

> I prefer using
>
> log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register Request\n”);
>
> That way you have the route block where you are logging from and the
> Call-ID with your information string. (I mostly use L_ERR when debugging)
>
> Cheers
> On Sat, 29 Dec 2018 at 11:02, Mojtaba  wrote:
>
>> Hi,
>> You could use xlog instead of log, like this:
>>  xlog("Register request...\n");
>> With Regards.Mojtaba
>>
>> On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
>>  wrote:
>> >
>> > Hi everyone,
>> >
>> > I have recently started working on Kamailio, I am trying to learn
>> the basics. For "Register" route, I am trying to print the log but log is
>> not appearing in log file. Other logs are there, only this one is 
>> missing.
>> >
>> > if(is_method("REGISTER")){
>> >  log(2, "Register request");
>> > }
>> >
>> > I will be really helpful if you can help me with this.
>> >
>> > Thanks & Kind Regards
>> >
>> > Regards,
>> > M.Allaudin
>> > Software Engineer
>> > Nowtel Group
>> > Phone # +92-333-8291874
>> > Blogger @ allaudin.github.io
>> > ___
>> > Kamailio (SER) - Users Mailing List
>> > sr-users@lists.kamailio.org
>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> --
>> --Mojtaba Esfandiari.S
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

>>> --
>>> *Paolo Visintin*
>>> *CTO*
>>> evosip.cloud
>>> [image: Risultati immagini per evosip]
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>


-- 

BR,
Denys Pozniak
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Logging from cfg file

2018-12-29 Thread Joel Serrano
Adding it to my log_prefix !!!

Sounds dum but this simplifies my logging so much 

Thanks guys, every day you learn something new!


On Sat, Dec 29, 2018 at 14:42 David Villasmil <
david.villasmil.w...@gmail.com> wrote:

> yep: $cfg(route)
> added Jun 2017
> Regards,
>
> David Villasmil
> email: david.villasmil.w...@gmail.com
> phone: +34669448337
>
>
> On Sat, Dec 29, 2018 at 10:09 PM * Paolo Visintin - evosip.cloud
>  wrote:
>
>> Joel , you could use $cfg(route) !
>>
>> I usually store my breadcrumbs in a define and use on top of every
>> interesting route !
>>
>>
>> Il giorno sab 29 dic 2018 alle 21:29 Joel Serrano  ha
>> scritto:
>>
>>> I wonder if there is a $something that contains the route-block-name?
>>>
>>> Anyone know?
>>>
>>>
>>> On Sat, Dec 29, 2018 at 10:52 David Villasmil <
>>> david.villasmil.w...@gmail.com> wrote:
>>>
 I prefer using

 log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register Request\n”);

 That way you have the route block where you are logging from and the
 Call-ID with your information string. (I mostly use L_ERR when debugging)

 Cheers
 On Sat, 29 Dec 2018 at 11:02, Mojtaba  wrote:

> Hi,
> You could use xlog instead of log, like this:
>  xlog("Register request...\n");
> With Regards.Mojtaba
>
> On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
>  wrote:
> >
> > Hi everyone,
> >
> > I have recently started working on Kamailio, I am trying to learn
> the basics. For "Register" route, I am trying to print the log but log is
> not appearing in log file. Other logs are there, only this one is missing.
> >
> > if(is_method("REGISTER")){
> >  log(2, "Register request");
> > }
> >
> > I will be really helpful if you can help me with this.
> >
> > Thanks & Kind Regards
> >
> > Regards,
> > M.Allaudin
> > Software Engineer
> > Nowtel Group
> > Phone # +92-333-8291874
> > Blogger @ allaudin.github.io
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> --
> --Mojtaba Esfandiari.S
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> --
>> *Paolo Visintin*
>> *CTO*
>> evosip.cloud
>> [image: Risultati immagini per evosip]
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Logging from cfg file

2018-12-29 Thread David Villasmil
yep: $cfg(route)
added Jun 2017
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337


On Sat, Dec 29, 2018 at 10:09 PM * Paolo Visintin - evosip.cloud
 wrote:

> Joel , you could use $cfg(route) !
>
> I usually store my breadcrumbs in a define and use on top of every
> interesting route !
>
>
> Il giorno sab 29 dic 2018 alle 21:29 Joel Serrano  ha
> scritto:
>
>> I wonder if there is a $something that contains the route-block-name?
>>
>> Anyone know?
>>
>>
>> On Sat, Dec 29, 2018 at 10:52 David Villasmil <
>> david.villasmil.w...@gmail.com> wrote:
>>
>>> I prefer using
>>>
>>> log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register Request\n”);
>>>
>>> That way you have the route block where you are logging from and the
>>> Call-ID with your information string. (I mostly use L_ERR when debugging)
>>>
>>> Cheers
>>> On Sat, 29 Dec 2018 at 11:02, Mojtaba  wrote:
>>>
 Hi,
 You could use xlog instead of log, like this:
  xlog("Register request...\n");
 With Regards.Mojtaba

 On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
  wrote:
 >
 > Hi everyone,
 >
 > I have recently started working on Kamailio, I am trying to learn the
 basics. For "Register" route, I am trying to print the log but log is not
 appearing in log file. Other logs are there, only this one is missing.
 >
 > if(is_method("REGISTER")){
 >  log(2, "Register request");
 > }
 >
 > I will be really helpful if you can help me with this.
 >
 > Thanks & Kind Regards
 >
 > Regards,
 > M.Allaudin
 > Software Engineer
 > Nowtel Group
 > Phone # +92-333-8291874
 > Blogger @ allaudin.github.io
 > ___
 > Kamailio (SER) - Users Mailing List
 > sr-users@lists.kamailio.org
 > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



 --
 --Mojtaba Esfandiari.S

 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> --
> *Paolo Visintin*
> *CTO*
> evosip.cloud
> [image: Risultati immagini per evosip]
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Logging from cfg file

2018-12-29 Thread * Paolo Visintin - evosip.cloud
Joel , you could use $cfg(route) !

I usually store my breadcrumbs in a define and use on top of every
interesting route !


Il giorno sab 29 dic 2018 alle 21:29 Joel Serrano  ha
scritto:

> I wonder if there is a $something that contains the route-block-name?
>
> Anyone know?
>
>
> On Sat, Dec 29, 2018 at 10:52 David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> I prefer using
>>
>> log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register Request\n”);
>>
>> That way you have the route block where you are logging from and the
>> Call-ID with your information string. (I mostly use L_ERR when debugging)
>>
>> Cheers
>> On Sat, 29 Dec 2018 at 11:02, Mojtaba  wrote:
>>
>>> Hi,
>>> You could use xlog instead of log, like this:
>>>  xlog("Register request...\n");
>>> With Regards.Mojtaba
>>>
>>> On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
>>>  wrote:
>>> >
>>> > Hi everyone,
>>> >
>>> > I have recently started working on Kamailio, I am trying to learn the
>>> basics. For "Register" route, I am trying to print the log but log is not
>>> appearing in log file. Other logs are there, only this one is missing.
>>> >
>>> > if(is_method("REGISTER")){
>>> >  log(2, "Register request");
>>> > }
>>> >
>>> > I will be really helpful if you can help me with this.
>>> >
>>> > Thanks & Kind Regards
>>> >
>>> > Regards,
>>> > M.Allaudin
>>> > Software Engineer
>>> > Nowtel Group
>>> > Phone # +92-333-8291874
>>> > Blogger @ allaudin.github.io
>>> > ___
>>> > Kamailio (SER) - Users Mailing List
>>> > sr-users@lists.kamailio.org
>>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>>
>>> --
>>> --Mojtaba Esfandiari.S
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-- 
*Paolo Visintin*
*CTO*
evosip.cloud
[image: Risultati immagini per evosip]
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Logging from cfg file

2018-12-29 Thread Joel Serrano
I wonder if there is a $something that contains the route-block-name?

Anyone know?


On Sat, Dec 29, 2018 at 10:52 David Villasmil <
david.villasmil.w...@gmail.com> wrote:

> I prefer using
>
> log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register Request\n”);
>
> That way you have the route block where you are logging from and the
> Call-ID with your information string. (I mostly use L_ERR when debugging)
>
> Cheers
> On Sat, 29 Dec 2018 at 11:02, Mojtaba  wrote:
>
>> Hi,
>> You could use xlog instead of log, like this:
>>  xlog("Register request...\n");
>> With Regards.Mojtaba
>>
>> On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
>>  wrote:
>> >
>> > Hi everyone,
>> >
>> > I have recently started working on Kamailio, I am trying to learn the
>> basics. For "Register" route, I am trying to print the log but log is not
>> appearing in log file. Other logs are there, only this one is missing.
>> >
>> > if(is_method("REGISTER")){
>> >  log(2, "Register request");
>> > }
>> >
>> > I will be really helpful if you can help me with this.
>> >
>> > Thanks & Kind Regards
>> >
>> > Regards,
>> > M.Allaudin
>> > Software Engineer
>> > Nowtel Group
>> > Phone # +92-333-8291874
>> > Blogger @ allaudin.github.io
>> > ___
>> > Kamailio (SER) - Users Mailing List
>> > sr-users@lists.kamailio.org
>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> --
>> --Mojtaba Esfandiari.S
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Logging from cfg file

2018-12-29 Thread David Villasmil
I prefer using

log(“L_ERR”, “[REQUEST_ROUTE]: $ci Register Request\n”);

That way you have the route block where you are logging from and the
Call-ID with your information string. (I mostly use L_ERR when debugging)

Cheers
On Sat, 29 Dec 2018 at 11:02, Mojtaba  wrote:

> Hi,
> You could use xlog instead of log, like this:
>  xlog("Register request...\n");
> With Regards.Mojtaba
>
> On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
>  wrote:
> >
> > Hi everyone,
> >
> > I have recently started working on Kamailio, I am trying to learn the
> basics. For "Register" route, I am trying to print the log but log is not
> appearing in log file. Other logs are there, only this one is missing.
> >
> > if(is_method("REGISTER")){
> >  log(2, "Register request");
> > }
> >
> > I will be really helpful if you can help me with this.
> >
> > Thanks & Kind Regards
> >
> > Regards,
> > M.Allaudin
> > Software Engineer
> > Nowtel Group
> > Phone # +92-333-8291874
> > Blogger @ allaudin.github.io
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> --
> --Mojtaba Esfandiari.S
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Logging from cfg file

2018-12-29 Thread Mojtaba
Hi,
You could use xlog instead of log, like this:
 xlog("Register request...\n");
With Regards.Mojtaba

On Sat, Dec 29, 2018 at 11:14 AM Muhammad Allaudin
 wrote:
>
> Hi everyone,
>
> I have recently started working on Kamailio, I am trying to learn the basics. 
> For "Register" route, I am trying to print the log but log is not appearing 
> in log file. Other logs are there, only this one is missing.
>
> if(is_method("REGISTER")){
>  log(2, "Register request");
> }
>
> I will be really helpful if you can help me with this.
>
> Thanks & Kind Regards
>
> Regards,
> M.Allaudin
> Software Engineer
> Nowtel Group
> Phone # +92-333-8291874
> Blogger @ allaudin.github.io
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



-- 
--Mojtaba Esfandiari.S

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users