Limiting digits to be used for app

I have written a speed dial app that walks my clients through programming global speed dial codes. I am trying to limit them to just using 600-699 for now. Below is what I have written to handle this but it does not seem to working

[speeddial]
exten => manage,1,Answer()
same => n(Start),Read(NEW,custom/speeddial/entercode,3)
same => n,Set(STEST=${DB(hosted/${CDR(accountcode)}/speeddial/${NEW})})
same => n,GotoIf($["${STEST}" != “”]?Overwrite)
same => n,GotoIf($[$[${STEST} < 600] & $[${STEST} > 699]]?invalid)
same => n,Goto(Number)

Not sure what I am doing wrong. Please help.

same => n,GotoIf($[$[${STEST} < 600] | $[${STEST} > 699]]?invalid)

–Satish Barot
satish4asterisk@gmail.com

used your replacement and now I’m getting these syntax errors from the cli and its still not functioning properly

== Using SIP RTP CoS mark 5
– Executing [*473@bcl-trusted:1] Goto(“SIP/bcl300-00000004”, “speeddial,manage,1”) in new stack
– Goto (speeddial,manage,1)
– Executing [manage@speeddial:1] Answer(“SIP/bcl300-00000004”, “”) in new stack
– Executing [manage@speeddial:2] Read(“SIP/bcl300-00000004”, “NEW,custom/speeddial/entercode,3”) in new stack
– Accepting a maximum of 3 digits.
– <SIP/bcl300-00000004> Playing ‘custom/speeddial/entercode.slin’ (language ‘en’)
– User entered ‘300’
– Executing [manage@speeddial:3] Set(“SIP/bcl300-00000004”, “STEST=”) in new stack
[Nov 19 08:14:30] WARNING[1816][C-00000004]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘<’, expecting $end; Input:
< 600
^
[Nov 19 08:14:30] WARNING[1816][C-00000004]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to wiki.asterisk.org/wiki/display/ … +Variables
[Nov 19 08:14:30] WARNING[1816][C-00000004]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘>’, expecting $end; Input:

699
^
[Nov 19 08:14:30] WARNING[1816][C-00000004]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to wiki.asterisk.org/wiki/display/ … +Variables
[Nov 19 08:14:30] WARNING[1816][C-00000004]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘|’, expecting $end; Input:
|
^
[Nov 19 08:14:30] WARNING[1816][C-00000004]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to wiki.asterisk.org/wiki/display/ … +Variables
– Executing [manage@speeddial:4] GotoIf(“SIP/bcl300-00000004”, “?invalid”) in new stack
– Executing [manage@speeddial:5] GotoIf(“SIP/bcl300-00000004”, “0?Overwrite”) in new stack
– Executing [manage@speeddial:6] Goto(“SIP/bcl300-00000004”, “Number”) in new stack
– Goto (speeddial,manage,7)
– Executing [manage@speeddial:7] Read(“SIP/bcl300-00000004”, “NEWEXT,custom/speeddial/enterphone,0”) in new stack
– <SIP/bcl300-00000004> Playing ‘custom/speeddial/enterphone.slin’ (language ‘en’)
– User disconnected

There should be only one […] and the | should be inside them.

This should have been on Asterisk Support.

Like this?
same => n,GotoIf($[${STEST} < 600 | ${STEST} > 699]?invalid)

STEST is blank and hence it is throwing errors.
Update the code like this and see.

same => n,GotoIf($["${STEST}" != “”]?Overwrite:invalid)
same => n,GotoIf($[$[${STEST} < 600] | $[${STEST} > 699]]?invalid:)

–Satish Barot
satish4asterisk@gmail.com

Thanks that worked!