[Serdev] Print AVPs [Was: DBG statments]
Alexandr Dubovikov
shurik at start4.info
Mon Apr 10 07:26:43 UTC 2006
On Mon, Apr 10, 2006 at 01:52:52AM +0200, Pupeno wrote:
> On Mon, 2006-04-10 at 00:19 +0200, Alexandr Dubovikov wrote:
> > On Sun, Apr 09, 2006 at 10:37:17PM +0200, Pupeno wrote:
> > > Hello,
> > > How do I get DBG statments to print ?
> >
> > 1. tail -f /var/log/messages | grep ser
> >
> > or
> >
> > 2. vi ser.cfg
> > debug=8 #your level debug hier
> > fork=no
> > log_stderror=yes
>
> Ok, maybe I asked the wrong question. I get too much output and grepping
> didn't show what I expected. I wast trying to print all the AVPs so I
> was doing avp_print(); on the config file without getting anything out
> of it. I checked the function and it does DBG().
> Now, the question basically is: How can I print all the AVPs
> succesfully ?
open your ser.cfg and check debug level, it should be 4.
debug=4
for example:
route {
.....
avp_write("404", "$early_code");
avp_write("Not found", "$early_reason");
log("**************** AVP PRINT START ******************\n");
avp_print();
log("**************** AVP PRINT END ******************\n");
....
}
and in /var/log/messages you will has smth like this:
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: **************** AVP PRINT START ******************
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG:avpops:print_avp
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG:avpops:print_avp: p=0x2aaaace6db40, flags=2
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG: id=<67>
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG: val_str=<Not found>
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG:avpops:print_avp: p=0x2aaaace6dab8, flags=2
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG: id=<66>
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG: val_str=<404>
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG:avpops:print_avp: p=0x2aaaace6d9f8, flags=3
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG: name=<string>
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: DEBUG: val_str=<00901>
Apr 10 09:17:41 stentor01 /usr/local/sbin/ser[27162]: **************** AVP PRINT END ******************
>
> > and if you want realy to print :-)
> Hehe, print as in printf ;)
> --
> Pupeno <pupeno at pupeno.com> http://pupeno.com
> _______________________________________________
> Serdev mailing list
> serdev at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serdev
Wbr,
--
Alexandr Dubovikov * baron at iRC RusNet * mailto:shurik at start4.info
AD1-UANIC * ICQ: 122351182 * http://www.start4.info
More information about the Serdev
mailing list