Member
Last active 6 years ago
Hi,
I was getting the following error when using the [fop2-park] code above:
[31/01/2018 - 22:32] WARNING[15380][C-000001de]: pbx.c:4502 pbx_substitute_variables_helper_full: Error in extension logic (missing ']')
[31/01/2018 - 22:32] WARNING[15380][C-000001de]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected $end, expecting '-' or '!' or '(' or '<token>'; Input:
The reason my error was coming up is the Asterisk context code is missing ']' on lines _X.,2 and _X.,3
The correct code should be:
[fop2-park]
exten => _X.,1,Set(ARRAY(RETURN_EXTENSION,RETURN_CONTEXT,PARKBUTTON)=${CUT(EXTEN,:,1)},${CUT(EXTEN,:,2)},${CUT(EXTEN,:,3)})
exten => _X.,2,GotoIf($["${PARKBUTTON}" = "PARK/default"]?5)
exten => _X.,3,GotoIf($["${PARKBUTTON}" = ""]?5)
exten => _X.,4,Set(PARKINGLOT=${PARKBUTTON:5})
exten => _X.,5,Park(,${RETURN_CONTEXT},${RETURN_EXTENSION},1,s)
Hope this helps.
Regards,
Simon.