[Asterisk-Users] Re: Compressing a dialplan
Maron Kristófersson
maron at transistor.tv
Thu Aug 26 13:56:46 MST 2004
By sorting the plan there should definitely be a way to do it, you will
need some algorithm that takes all the numbers digit by digit ( first go
through all digits nr. 1 in all possible numbers, then nr. 2...).
However what you're trying to do makes me think if asterisk shouldn't be
able to pass Early Dial on to the telephone network channels. What I am
thinking is that you could define in extensions.conf that you wan't the
Zap or Capi device to start sending numbers immediately, if the Zap
device get's a complete number before the dialplan in extensions.conf it
will decide that the call belongs to it and hooks up with the ringing
notification to the caller. However if the number matches an extension
already defined in the dialplan, it will hook up to that one.
The Zap channel could be made listening by default, or only if the first
character is a specific character like 0.
This would be a sacrifice of a Zap channel everytime somebody starts
dialing but I think it's worth it in many cases.
Probably this has been thought of before (or am I forgetting the minor
detail that ruins the idea?) but I would like to hear what the
developers have to say about it?
Maron Kristofersson, Staffanstorp, Sweden
Tobias Jönsson wrote:
> 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.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list