Realtime sorting


I have just startet using Realtime Extensions on Asterisk 1.6 (MySQL)

I have a context called Extensions, it looks something like this:

switch => Realtime

exten => 199,1,macro(agentcall,199,${EXTEN})
exten => _2XX,1,dial(SIP/${EXTEN})
exten => _3XX,1,dial(DAHDI/g3/39559${EXTEN},70)[/ul]
In the Realtime database, I have an extension called 217.

My problem is that calls to 217 is handeled by the _2XX extension, not 217.
If I remove the line with _2XX, it is handeled by 217 from the database as I expected it to be.

So it seems like Asterisk is not looking for the closest match, but on something else (first match?)
Is this a bug, or something that I have not done right?


Noone has any comments about this?

Please help, it is a big problem for us.


I believe Asterisk will use a match in a context before trying included contexts; I presume a switch behaves like an included context.

This may well be version dependent.

the realtime puts the whole lot of the context to the database.

Currently i use the LDAP realtime driver and in ldap i set users AND the dial plans for each user.

so if you have an extension 220, in the database should be made a dial plan that routes to 220.