[asterisk-users] How to check if channel varaible have been set/notempty?

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Thu Aug 3 05:58:32 MST 2006


On Thursday 03 August 2006 08:03, Rushowr wrote:
> Use the ISNULL function. ISNULL will return a value of 1 if the string it's
> fed contains data. Example:
>
> If you set VARNAME=foo, and then grab the value of ${ISNULL(${VARNAME})},
> it will be 0 because VARNAME has data


Just for clarification... ISNULL returns nonzero if the variable is null.  
e.g. Set(VAR=foo); ISNULL(${VAR}) evaluates to false (0).  Set(VAR=); 
ISNULL(${VAR}) should evaluate true (1).

Your first and second sentences are at odds.  :-)

-A.



More information about the asterisk-users mailing list