[asterisk-dev] new priority of pattern matching in 1.4. Does it makes sense?
Tony Mountifield
tony at softins.clara.co.uk
Thu Feb 21 08:48:21 CST 2008
In article <1203544372.4319.102.camel at ibmlaptop.darkcore.net>,
John Lange <john.lange at open-it.ca> wrote:
> [...]
> Far from being an improvement this change has caused our dialplans to be
> much messier and inefficient. I'll try and give a brief example and
> maybe someone can explain how this can be done with 1.4.
>
> In a situation where you have many classes of users, many sections of
> the dialplans for these users will be identical with only minor
> differences (perhaps for different outbound trunking).
I think include sections are searched in the order they are specified,
so put the class-specific rules into their own context for each class,
and include that context after the more specific ones.
> e.g.
>
> ; Class 1 users uses 2 cheap SIP and IAX proviers for
> ; long distance but uses the PRI for local calls.
> [class1]
> include => local_calls
> exten => _1555NXXXXXX,1,Dial(SIP/${EXTEN}@provider1)
> exten => _1NXXNXXXXXX,1,Dial(iax2/2195 at provider2/${EXTEN})
> exten => _011.,2,Dial(iax2/1234 at provider2/${EXTEN})
> include => toll_free
[class1]
include => local_calls
include => toll_free
include => class1_rules
[class1_rules]
exten => _1555NXXXXXX,1,Dial(SIP/${EXTEN}@provider1)
exten => _1NXXNXXXXXX,1,Dial(iax2/2195 at provider2/${EXTEN})
exten => _011.,2,Dial(iax2/1234 at provider2/${EXTEN})
> ; Class 2 uses cheap provider for international but use PRI for
> ; all other calls.
> [class2]
> include => local_calls
> exten => _1555NXXXXXX,1,Dial(${PRITRUNK}/${EXTEN})
> exten => _1NXXNXXXXXX,1,Dial(${PRITRUNK}/${EXTEN})
> exten => _011.,2,Dial(iax2/1234 at provider2/${EXTEN})
> include => toll_free
[class2]
include => local_calls
include => toll_free
include => class2_rules
[class2_rules]
exten => _1555NXXXXXX,1,Dial(${PRITRUNK}/${EXTEN})
exten => _1NXXNXXXXXX,1,Dial(${PRITRUNK}/${EXTEN})
exten => _011.,2,Dial(iax2/1234 at provider2/${EXTEN})
And so on.
Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
More information about the asterisk-dev
mailing list