Dialplan & Need help - Cant Figure this out

2022-07-04 19:43:46] WARNING[6662][C-00000005]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘=’, expecting $end; Input:

this is dialplan
same => n,GotoIf($[${dtmfno}=“”]?endcall:nextstep)
same => n(nextstep),set(nextstep=1)

As far as variables are concerned, the dialplan processor is a macro processor, so an empty variable gets turned into nothing at all, not into an indication of an empty variable. You can either put double quotes round the variable, or use the EXISTS function, noting that he latter detects the absence of anything, not an empty variable.

like this?

yes or even simpler

same => n,GotoIf(${EXISTS(${dtmfno})}?nextstep:endcall)

same => n,GotoIf($[“${dtmfno}”=“”]?endcall:nextstep) should work

Another way of doing it:

same => n,GotoIf($["foo${dtmfno}"="foo"]?endcall:nextstep)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.