[asterisk-users] Logical AND

Adrian Marsh Adrian.Marsh at ubiquisys.com
Sun May 25 09:38:28 CDT 2008


From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tilghman
Lesher
Sent: 25 May 2008 15:07
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Logical AND

On Sunday 25 May 2008 07:10:22 Adrian Marsh wrote:
> exten => s,n,ExecIf( $[  $[ "${PSTN_NUM:0:1}" != "0" ] & $[
> ${LEN(${PSTN_NUM})} = 10 ]  ] |Set|PSTN_NUM=001${PSTN_NUM})
>
>     -- Executing [s at macro-setpstncli:8] NoOp("SIP/427-b7d9a9a0",
> "0123456789") in new stack
>     -- Executing [s at macro-setpstncli:9] ExecIf("SIP/427-b7d9a9a0", " 0
> |Set|PSTN_NUM=0010123456789") in new stack
>     -- Executing [s at macro-setpstncli:10] NoOp("SIP/427-b7d9a9a0",
> "0010123456789") in new stack

There's an extra space between the opening "(" and the opening "$[", so
the result is space-zero, which is not the same thing as zero.  Any
string
that is not exactly "0" (or the empty string), such as "foo", " ", or "
0" is
true.

-- 
Tilghman


---------

I did wonder where the extra spaces were coming from, but I thought that
was where the quotes were supposed to come into play...  Well that got
it working so thanks guys..



More information about the asterisk-users mailing list