[SR-Users] How to set variable externally

Olle E. Johansson oej at edvina.net
Fri Dec 21 19:21:11 CET 2012


21 dec 2012 kl. 17:34 skrev Mino Haluz <mino.haluz at gmail.com>:

> Ok I did it like this, every xlog I'm calling is in the form:
> 
> xlog("L_INFO","XLOG: $ci [ROUTENAME] debuginformation"); 
> 
> and also after every sql_query I have
> 
> xlog("L_INFO","XLOG: $ci [ROUTENAME] SQL: select * from ....");
> 
> and when SIP message is received/sent
> 
> xlog("L_INFO","XLOG: $ci [MAIN] $mb");
> xlog("L_INFO","XLOG: $ci [event:onsend_route] $snd(buf)");
> 
> So when I'm vizualizing the siptrace, I can view all SQL queries, raw packets (it is done already by siptrace however) and additional debug logs associated to one particular callid. 
> 
> The question is, has xlog maximum length of the second parameter ? Because when SIP message length exceed some value (around 1500bytes, maybe some relation to packet max size) it is stripped. 
> So when calling xlog("L_INFO","XLOG: $ci [event:onsend_route] START $snd(buf) END"); and $snd(buf) is too big, it is stripped and END is not in the logs.
Could be the syslog/rsyslog configuration. Check syslog.  There's also a pv buffer size you can set in the kamailio configuration - check the core cookbook.

Kamailio xlog logs to your syslog daemon.

Guessing a bit here.
/O
> 
> Are you aware of maximum length of this xlog message parameter? I cannot find it in documentation. 
> 
> Mino.
> 
> 
> On Fri, Dec 21, 2012 at 5:18 PM, Daniel-Constantin Mierla <miconda at gmail.com> wrote:
> 
> On 12/21/12 5:15 PM, Olle E. Johansson wrote:
> 21 dec 2012 kl. 17:10 skrev Ovidiu Sas <osas at voipembedded.com>:
> 
> If you just want to control the debug level externally, take a look at
> the debug parameter:
> http://www.kamailio.org/wiki/cookbooks/3.3.x/core#debug
> It can be controlled via sercmd (kamcmd in future versions).
> 
> If you want to play with global flags, take a look at cfgutils:
> http://kamailio.org/docs/modules/3.3.x/modules_k/cfgutils.html
> http://kamailio.org/docs/modules/3.3.x/modules_k/cfgutils.html#id2533439
> http://kamailio.org/docs/modules/3.3.x/modules_k/cfgutils.html#id2494518
> http://kamailio.org/docs/modules/3.3.x/modules_k/cfgutils.html#id2494559
> 
> For your own logs:
> 
> I usually declare a shared variable called "debug" in the pv module modparams.
> 
> When logging i do
> 
> if ($shv(debug) > 0)
>     xlog(....)
> 
> All shared variables, like Daniel said, can be changed with kamctl/sercmd.
> More for the sake of archiving, one can even do:
> 
> xlog("$shv(debug)", ...);
> 
> and if $shv(debug) > than the value of debug parameter, then the message is not printed, otherwise will be printed to the level corresponding to its value.
> 
> Cheers,
> Daniel
> 
> 
> -- 
> Daniel-Constantin Mierla - http://www.asipto.com
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> 
> 
> _______________________________________________
> 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
> 
> _______________________________________________
> 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/20121221/c36afb81/attachment-0001.htm>


More information about the sr-users mailing list