[asterisk-dev] new priority of pattern matching in 1.4. Does it makes sense?

Jared Smith jsmith at digium.com
Sat Feb 23 12:36:33 CST 2008


On Fri, 2008-02-22 at 10:31 -0600, John Lange wrote:
> Kudos Jared for citing a good example. At least now I see that there is
> at least one practical application of this methodology.

I'm glad you liked my example.

> My point is simply that this example doesn't work with the existing
> system. "convert-to-local" never matches because "long-distance" is
> always a higher priority.

I'm not following you here.  I pasted your example into my
extensions.conf, reloaded the dialplan, and then examined the dialplan:

localhost*CLI> dialplan show 15552221212 at class1
[ Included context 'convert-to-local' created by 'pbx_config' ]
  '_1555222XXXX' => 1. Dial(IAX2/some_itsp/${EXTEN:4})            [pbx_config]

[ Included context 'block-ld' created by 'pbx_config' ]
  '_1NXXNXXXXXX' => 1. Playback(this-call-is-not-allowed|n)       [pbx_config]
                    2. Congestion(5)                              [pbx_config]
                    3. Hangup()                                   [pbx_config]


This clearly shows that for the lobby phone (pointing at the class1
context), the convert-to-local context is the first to match.

Same thing for the class2 context:

localhost*CLI> dialplan show 15552221212 at class2
[ Included context 'convert-to-local' created by 'pbx_config' ]
  '_1555222XXXX' => 1. Dial(IAX2/some_itsp/${EXTEN:4})            [pbx_config]
 
[ Included context 'long-distance' created by 'pbx_config' ]
  '_1NXXNXXXXXX' => 1. Dial(IAX2/some_itsp/${EXTEN})              [pbx_config]

And the same holds true for the class3 context as well:

localhost*CLI> dialplan show 15552221212 at class3
[ Included context 'convert-to-local' created by 'pbx_config' ]
  '_1555222XXXX' => 1. Dial(IAX2/some_itsp/${EXTEN:4})            [pbx_config]
 
[ Included context 'long-distance' created by 'pbx_config' ]
  '_1NXXNXXXXXX' => 1. Dial(IAX2/some_itsp/${EXTEN})              [pbx_config]
  
[ Included context 'convert-to-local' created by 'pbx_config' ]
  '_1555222XXXX' => 1. Dial(IAX2/some_itsp/${EXTEN:4})            [pbx_config]

I'm really confused as to why this isn't working for you, as it's
clearly working the way you intended here in my dialplan.  I'd be
interested in seeing the output of the "dialplan show" commands from
your system.

-- 
Jared Smith
Community Relations Manager
Digium, Inc.




More information about the asterisk-dev mailing list