[asterisk-users] AEL: how to check if variable is defined

Klaus Darilion klaus.mailinglists at pernau.at
Tue Dec 30 00:53:45 CST 2008


Thanks Dave, Philipp and Richard!

klaus

Richard Lyman wrote:
> Philipp Kempgen wrote:
>> Richard Lyman schrieb:
>>   
>>> Philipp Kempgen wrote:
>>>     
>>   
>>>> But I guess it wouldn't hurt to add a DEFINED() function to
>>>> Asterisk.
>>>>
>>>> if (DEFINED(myvariable)) {
>>>>     // ...
>>>> }
>>>>   
>>>>       
>>> Isn't that what ISNULL is for?
>>>     
>> No. ISNULL() works on values not on variables.
>>
>> But Dave Fullerton found EXISTS():
>> http://lists.digium.com/pipermail/asterisk-users/2008-December/224059.html
>>
>>
>>    Philipp Kempgen
>>
>>   
>                 if (${ISNULL(${CAMPAIGN})}) {
>                         Set(CAMPAIGN=INBOUND);
>                 };
> 
> This is how i use it.
> 
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list