[asterisk-users] Single = sign and double == sign.What is the difference and when to use the two properly?

Eric Wieling EWieling at nyigc.com
Fri Jan 11 13:49:10 CST 2013


In Asterisk extensions.conf and extensions.ael inside $[] "=" and "==" are the same comparison operator.  I can't quote where I saw this, but it has been documented somewhere.  The == was added to make things more "programmer friendly".



-----Original Message-----
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of penguin
Sent: Friday, January 11, 2013 10:50 AM
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] Single = sign and double == sign.What is the difference and when to use the two properly?

quick question that leaves alittle confusion here. Im confused on the difference or when to use the other if i have 1 = sign or 2 == signs .. so If i had

exten => _XXXX,1,answer()
    same=> n,Set($[${a}==1]?true:false]  <--double equal sign
    same => n(true),Goto(main,s,1)
    same=> n(false), Hangup()
would this be saying the same thing as above then?

exten => _XXXX,answer()
    same=> n,Set($[${a}=1]?true:false] <-- single equal sign

in essence wouldn't i get the same result ? im confused on the double and single equal sign and when to use the difference of the two. Would i get the same result in both these expressions?



More information about the asterisk-users mailing list