[asterisk-users] can not get ${LEN(VAR)} and greater than ">" to work for me

John Millican jmillican at sentinelcommunications.com
Sun Aug 27 05:50:15 MST 2006


On Saturday August 26 2006 11:15 am, Matt Riddell (IT) wrote:
> John Millican wrote:
> > Hello all,
> > I am trying to test if the length of a dialed number is greater than 7. 
> > When i use:
> > exten => 1,n,GoToIf($["${LEN(${numdial})}">"7"]?dialout:nodial);
> > and I dial an 11 digit number i.e. 1 800 xxx xxxx
> > i get this in the console:
> > Executing GotoIf("SIP/xxx-xxx-xxx-xxx-006ca720", "0?dialout:nodial") in
> > new stack
> >
> > indicating that the number was not greater than 7.
> > if i use:
> > exten => 1,n,GoToIf($["${LEN(${numdial})}"="11"]?dialout:nodial);
> > and dial the same 1 800 xxx xxxx
> > i get:
> >
> > Executing GotoIf("SIP/xxx-xxx-xxx-xxx-006ca720", "1?dialout:nodial") in
> > new stack
> > indicating that the length of number dialed was equal to 11 digits.
> > so equal to works and greater than does not?
> > Can any one see what I am doing wrong?
> > *  version 1.2.9.1
>
> Maybe string comparison because of the speech marks?

Thank You Matt and Ira
The speech marks/quotes were the problem. 
Matt sorry about the earlier direct mail used R instead of L for the reply.
John M




More information about the asterisk-users mailing list