PBX2CLI> dialplan show 123@testing
Alt. Switch => ‘Realtime/@’ [pbx_config]
There is no existence of 123@testing extension
Command ‘dialplan show 123@testing’ failed.
PBX2CLI>
I’m aware of that, but as seen from the error, even that pattern doesn’t match the extension 123. I’ve added the 3rd entry just out of curiosity if it’ll match it.
Paste the cli raw information.
Dialplan execution it finishes on second stage “Dial” application. If _x. pattern match with 101 it goes to extension 101, others pattern it will fail and channel will release and stop.
In both case it will never reach to the third stage.
Asterisk should ALWAYS pick the MOST specific match, when matching extensions in the dialplan, regardless of their order. Unless there’s something I’ve misunderstood.
I don’t remember if Asterisk has fallthough, but I think they removed that WAY back around 1.2 or 1.4, so let’s assume there’s no fall through.
With the context testing as above, running dialplan show 123@testing in the console, should display both the steps for 123 and the steps for _X., but when actually CALLING 123 only the steps for 123 should be executed. (If I’m remembering wrong and Asterisk DOES fall through, it will first execute the steps in 123, then continue with _X.)
And as such, when dialing 123, this is what should be executed, NOT whatever is defined by _X.
So with the above dialplan, if you dial 123, the dialplan for _X. will NEVER be executed.
If you dial anything BUT 123, the dialplan for _X. will be executed.
A flow in the dialplan does NOT need to use the Dial application at all, I have several flows in my setup, that never runs dial. Some doesn’t even answer the channel.
-- Executing [111111@<REDACTED>:1] NoOp("PJSIP/<REDACTED>-00000005", "A:111111") in new stack
-- Auto fallthrough, channel 'PJSIP/<REDACTED>-00000005' status is 'UNKNOWN'
On the SIP level, the call is rejected with a 603 Decline response.
From what I understand you said, this example should result in AT LEAST 111111 and _X. being executed, and if it’s falling through from most to least specific, all of them, in the order written here, should be executed.
It doesn’t really seem intuitive, that it can continue at a “random” priority for another extension, just because it happens to match the expression. I did not test that variant, but it sounds like something that might very well be true.
Yeah, i know it’s not truly random, hence the quotes. But if you’re not aware of this behavior, it could easily feel random.
Seems like a case of either “Seemed like a good idea at the time”, “Didn’t think of that as a problem” or “It’s always been like that, better not change it”.
But certainly something worth keeping in mind, when designing dialplans. With all the crazy stuff I’ve made, I guess I’ve just been lucky for this never to interfere with what I’ve made.
True, but that’s still ALL you need to figure out how the dialplan is processed. But from what others have added, I think I get how it works, even though it makes no sense why it’s implemented like that.