Hi,
Let’s say I have a simple dialplan like this one:
[default]
exten => _XXXX,1,NoOp(${CALLERID(all)} is dialing ${EXTEN})
same => n,Gosub(custom-dialout-1,s,1(${EXTEN}))
same => n,Gosub(custom-dialout-2,s,1(${EXTEN}))
same => n,Hangup()
include => to-extensions
include => outbound
include => invalid
[to-extensions]
#tryinclude custom_extensions/*.conf
An example .conf file in custom_extensions would be:
exten => 1000,hint,PJSIP/${EXTEN}&PJSIP/web${EXTEN}
exten => 1000,1,NoOp(${CALLERID(num)} is calling 1000)
same => n,Set(CDR(userfield)=SIPCALLID:${CHANNEL(pjsip,call-id)})
same => n,Dial(PJSIP/${EXTEN}&PJSIP/web${EXTEN},,tTXg)
same => n,Log(NOTICE, ${EXTEN} dial status is ${DIALSTATUS})
same => n(hangup),Hangup()
If I were to dial 1000 would it match the _XXXX pattern in default first or ‘1000’ in to-extensions?
I’m asking because no matter where I place “includes =>” a ‘dialplan show’ will always move them at the end of a context.
eg.:
# asterisk -rx "dialplan show default"
[ Context 'default' created by 'pbx_config' ]
'_XXXX' => 1. NoOp(${CALLERID(all)} is dialing ${EXTEN}) [extensions.conf:5]
2. Gosub(custom-dialout-1,s,1(${EXTEN})) [extensions.conf:6]
3. Gosub(custom-dialout-2,s,1(${EXTEN})) [extensions.conf:7]
4. Hangup() [extensions.conf:8]
Include => 'to-extensions' [pbx_config]
Include => 'outbound' [pbx_config]
Include => 'invalid' [pbx_config]
I think the order of the includes or patterns is irrelevant, right?
I believe it all boils down to whether a pattern is more specific than another.
However, what would happen if I were to add:
exten => _X.,1,NoOp(catch-all pattern)
same => n,Hangup()
at the very top of the [default] context and I were to dial 1000?
Would it match _X., ‘1000’ or _XXXX?
Vieri