EndIf() causes next priority to be skipped


After the release of Asterisk version 20.6.0, I decided to set up a new test installation on a Debian 12 machine. I built Asterisk from source, as I always do, without any errors, and then I put my configurations and dialplan in place, built my database, and so on.

The thing is, when testing the dialplan, I encountered what may (or may not) be an issue with the ‘EndIf()’ application. When running an ‘if’ branch where the expression was true (see dialplan from priority 25 onwards), upon reaching ‘EndIf()’ (priority 28), the log shows that Asterisk is jumping to priority 29 and continuing execution from there. However, priority 29 (ConfBridge()) is never executed, going straight to priority 30 where a block of ‘GotoIf()’ begins, causing a loop because there is a ‘Goto’ pointing to the label “ENTRASAL1” up above.

ConfBridge should be executed to place the user in the dynamically created conference room; that’s how it works in Asterisk 18, where this dialplan runs on the production machine, and even in version 20.5.0, which I used for testing.

In any case, I am posting the relevant dialplan here, as well as the debug information, to find out from you whether it’s a configuration error or a bug that I should report in the GitHub issue tracker.
I appreciate your help!
Thank You!

debug-log.txt (125.4 KB)
dialplan.txt (2.0 KB)

That sounds like a bug. I can’t quickly find the code for a straightforward GoTo, but priority is, basically, a program counter, and it is common to update the program counter at the end of the instruction cycle, but the code assumes that it has already been updated before the application is run.

The silly thing, in this case, is that EndIf doesn’t need to manipulate the priority at all; it is Else that would need to do that, and probably If. If EndIf gets executed, the normal execution sequence would take it to the right place.

I’m a bit uneasy about the whole construct. The code is looking ahead, at run time, to find the EndIf. It isn’t like a compiler would handle these constructions, at compile time.

I wonder if this was done as a Summer job and not properly supervised, as it should have come out in the testing.

As I say, I haven’t dug far enough into the code to check when the priority is stepped.

Bugs need to be raised on the issue tracker.

Okay. Now, in order to send a bug report, are the files I provided sufficient, or should I have anything else on hand? do i need to do more testing?

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