How can I check if a string is empty in the dialplan? Is it possible to include different conditions in one “GotoIf” function? I’m trying the following and it doesn’t work:
same => n,GotoIf($["${value}" != "" ]?optionA:optionB)
it goes always to “optionB”, whether values is empty or not
On your original, that normally should work, except possibly that you should try it without any spaces.
The thing to remember with the second one is that this is basically a macro processor ${value_number} substitutes as nothing, so what gets parsed is “> 10”. However I cannot think why it would not fault until the :. Is it possible that some characters got mangled, e.g. smart quotes, when added to the file. you should probably prefix with a 0, when doing a numeric comparison, or try a leading + sign.
I just had another issue combining different conditions, as I didn’t know I had to put them all inside the same brackets:
same => n,GotoIf( $[ $[${EXISTS(${value})}] | $[${value_number} > 10] ]