Unexpected dialplan match

Home » Asterisk Users » Unexpected dialplan match
Asterisk Users 3 Comments

I was wondering why *foo@default should match ‘_*[0-9a-zA-Z].*0.’
in 1.6.13. Who is making the parse error, * or me?

CLI> dialplan show *foo@default
‘_*[0-9a-zA-Z].*0.’ =>
1. NoOp(${EXTEN}) [pbx_config]
2. Set(accountcode=${CUT(EXTEN,*,2)}) [pbx_config]
3. Set(extension=${CUT(EXTEN,*,3)}) [pbx_config]
4. Set(CDR(accountcode)=${accountcode}) [pbx_config]
7. ResetCDR() [pbx_config]
8. …

3 thoughts on - Unexpected dialplan match

  • ‘.’ stops further matching. Your extension ends up being (effectively)
    shortened to _*[0-9a-zA-Z].

  • That explains a lot, never read it this way before. Thanks for the eye
    opener.

    What I’m looking for is a extension that handles:
    ^*w+*d+$

    I guess I’ll have to catch _*. and manually check if it matches above
    regexp.