[OpenSIPS-Users] $var(NAME) = NULL; what is the value ?

Jarrod Baumann jarrod at unixc.org
Fri Jul 3 05:52:47 CEST 2015


I guess that documentation needs to be updated because it appears NULL support was added to pseudo vars at some point. I traced down the pvar assignment in gdb where the flag was NULL and it was assigned str_null:

static char _str_null_hlp[7] = {'<','n','u','l','l','>',0};
static str str_null   = { _str_null_hlp, 6 };

The default used to by PV_VAL_INT I guess which always initialized to 0… however this may have posed a problem along the way when actually needing to represent a NULL value returned from a database or something else.

Jarrod

> On Jul 2, 2015, at 9:20 PM, Podrigal, Aron <aronp at guaranteedplus.com> wrote:
> 
> According to the documentation here [1] the value of $var(NAME) = NULL; should be the integer 0.
> However when I test it with xlog, it does print <null>.
> 
> 
> [1] http://www.opensips.org/Documentation/Script-CoreVar#toc1 <http://www.opensips.org/Documentation/Script-CoreVar#toc1>
> 
> -- 
> Aron Podrigal
> -
> //Be happy :-)
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150702/1ef3d1c8/attachment-0001.htm>


More information about the Users mailing list