After more than an hour of debugging a very simple context, I have found that gotoif() does not tolerate whitespace after the condition. Any whitespace after the question mark causes the dialplan to end immediatly.
I would prefer that the gotoif() application ignore whitespace in the label area, but if whitespace is forbidden I will follow the rules. But it would be a kind gesture to note this in the documentation. I am sure that a lot of other programmers use whitespace for readability and expect the compiler or interpreter to ignore it (unless quoted).
I am using 220.127.116.11 which was the latest 1.8 when I compiled it. I see that there is now a 1.8.11.
I ask that this unexpected (and startling) restriction be documented in the gotoif() function. Or if it is an easy change, it would be better to fix the function so it tolerates whitespace.
I think this is an appropriate request, but I am demanding nothing, just trying to ask nicely. I really appreciate the work that the developers have donated to this fine system.
It looks like everything goto-related winds up at pbx_parseable_goto(). It would be very easy to replace ast_strdupa() with simple code to allocate the temporary memory and copy while removing whitespace. I would be glad to submit a patch for this. But first, is there a reason for not allowing whitespace? If there is a reason to forbid whitespace, I will respect that, but please put that reason in the documentation. Thanks.