[Asterisk-Dev] Sorting the dialplan

Daniel Pocock daniel at readytechnology.co.uk
Tue May 24 05:57:39 MST 2005


Andrew Thompson wrote:
> Daniel Pocock wrote:
> 
>>
>> I understand from reading the Wiki that the dialplan is sorted in 
>> alphabetical order, so _44. would come before _447. for instance.
>>
>> Is there any plans to offer an option that sorts a context by some 
>> other means, for instace, by looking for the longest matching prefix, 
>> or is there some other way to achieve this?
> 
> 
> Have you tried changing the _44. to _44[012345689]. or _44[01-689]. ? Or 
> does this break further logic?

I had thought of that, but it would look messy with thousands of 
prefixes.  The way to do it would be to pad every prefix up to the 
length of the longest one, like so:

_44871
_44870
_4480X
_4477X
_4478X
_4479X
_441XX
_442XX
_44XXX

However, this means the program generating the extensions.conf file 
needs to think about how much padding is required, and I am keen to find 
a mechanism that is just a little more elegant.



> 
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3214 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20050524/34eab0e7/smime.bin


More information about the asterisk-dev mailing list