[asterisk-dev] RealTime, Large Dialplans, and headaches... got any ideas?

Steve Murphy murf at digium.com
Tue Mar 27 13:35:05 MST 2007


OK, I just closed 9037 after a conversation with kpfleming.
Here is the situation:

9037's reporter is complaining that with a large dialplan, in order to
look up an extension, and do the pattern matching, asterisk pulls every
extension from the context in the DB, and tries to find the best match.
When the dialplan gets big, and you have hundreds/thousands (or more) of
extensions, then this takes a while. The user was reporting 5 or more
seconds.

I've been working on a search-tree algorithm that would find an
extension match a bit faster in a large dialplan. It's speed is a
function of the length of the patterns, not of how many extensions there
are. I thought I might apply this to the RT extensions, and keep an
in-mem copy of the search tree... but it depends on a lot of things,
like being able to discern an update to the DB of the dialplan, so you
can reform (or spot edit, which I believe is possible) the in-mem search
tree.

Kevin pointed out:

        This is impossible because you have no way of knowing when the
        database
        is modified. Even if you did, you'd have to resort to rebuilding
        the
        'search tree' in memory, and if the dialplan is large enough
        then the
        other issue comes into the picture as well.
        
        This is an artifact of the way the Realtime system is
        architected, which
        means that it is broken. It is not fixable in the current
        architecture.

If someone in the community has a brilliant flash of inspiration as to
how this problem could be solved, we'd love to hear about it! Any ideas?

murf

        
-- 
Steve Murphy
Software Developer
Digium



More information about the asterisk-dev mailing list