[Asterisk-Users] Re: Compressing a dialplan

Tobias Jönsson asterisk at tobiasjonsson.se
Wed Aug 25 23:23:47 MST 2004


On Wed, 25 Aug 2004, Maron Kristófersson wrote:

> Hmm, that raises a lot of questions for the script... How many contexts 
> do you have? Do they include each other.  Is there any kind of rule 
> around the extensions... etc.

All the extensions will just run the same macro so all these are just the 
same. What I did is that I converted the Swedish national numbering plan 
(E.164) with an AWK script to an extension like file. The purpose is being 
able to use early dialling for national calls (no overlap dialling 
available). It contains the starting digits and number lengths, like this:

04623XXXX
0462400XXX
0462401XXX
0462402XXX
0462403XXX
0462404XXX
0462405XXX
0462406XXX
0462407XXX
0462408XXX
0462409XXX
046241XXXX
046242XXXX
046243XXXX
046244XXXX
0462450XX
0462451XX
0462452XX
0462453XX
0462454XX
0462455XX
0462456XX
0462457XX
0462458XX
0462459XX
046246XXX
046247XXX
046248XXX
046249XXX
04625XXXX
0462600XXX
0462601XXX
0462602XXX
0462603XXX
0462604XXX
0462605XXX
0462606XXX
0462607XXX
0462608XXX
0462609XXX
046261XXXX
046262XXXX
046263XXXX
046264XXXX
046265XXXX
046266XXXX
046267XXXX
046268XXXX
046269XXXX

It's obvious that the following four lines will match exactly the same 
numbers as all the lines above:

0462[35]XXXX
04624[0-4]XXXX
04624[5-9]XXX
04626XXXXX

That is the conversation I would like a macro/script to do. What I thought 
about was if there are any kind of regexp compression programs or 
something like that.

-- 
Regards,
Tobias Jönsson, Lund SE


More information about the asterisk-users mailing list