Syntax error: syntax error, unexpected '=', expecting $end;

Can anyone tell me what’s wrong with this?

exten => ${EXTERNAL-IPPI-NUM},n,Playback(welcome)
; User chooses language, 2=English, 1=French, default French
exten => ${EXTERNAL-IPPI-NUM},n,Read(lang,"custom/fr-then-en",1,,2,3)
exten => ${EXTERNAL-IPPI-NUM},n,GotoIf($[${lang} = 2]?keepeng)

It works, but this is what happens:

If the user does enter something, then there’s no warning:

I can’t remember seeing this before I upgraded to 1.6.1.0, but I suppose I might not have noticed it :confused:.

Thanks
Ian

It’s a macro processor, so the actual expression parser sees $[=2]. Try quotes round the variable and the 2.

Excellent,exten => ${EXTERNAL-IPPI-NUM},n,GotoIf($["${lang}" = "2"]?keepeng) has fixed the problem.

Many thanks
Ian