[asterisk-dev] enhanced 'hint' functionality
Johansson Olle E
olle at voop.com
Thu Dec 7 01:01:29 MST 2006
7 dec 2006 kl. 05.11 skrev Thomas Andrews:
> On Wed, Dec 06, 2006 at 09:12:51PM +0100, Olle E Johansson wrote:
>
>>
>> 6 dec 2006 kl. 20.02 skrev Thomas Andrews:
>>
>>> I want to implement hints such as this:
>>>
>>> exten => _2XXX,hint,agi,agi_script|${EXTEN}
>>>
>>> As I understand it, only global varibles may be used in hints
>>> currently.
>>>
>>> Does anyone know how much effort this would require for me to
>>> implement?
>>> I'm not familiar with that part of the asterisk code, so I don't
>>> know if
>>> I'm biting off more than I can chew. What I mean is, would this
>>> change
>>> fit in reasonably well with the existing architecture?
>>>
>>> I'd appreciate any suggestions.
>>>
>>
>> So please explain what would happen with this, what's the
>> functionality you're looking for?
>>
>> HINTs are not used for calling, so global variables doesn't really
>> apply there.
>
> I want the LEDs on (eg) snom phones to light up when buttons on the
> phone are associated with extensions (eg Zap channels) going active.
> Snoms use the "SUBSCRIBE" feature to do this.
>
> I want to avoid having to have hints such as this in my dialplans:
>
> exten => 200,hint,Zap/17
> exten => 203,hint,Zap/3
> exten => 209,hint,Zap/12
> exten => 222,hint,Zap/7
> exten => 286,hint,Zap/11
>
> In other words I want to avoid having any hints hard-coded in the
> dialplan, and would instead like variables and/or calls.
>
> I am using agi scripts currently to look up the relationship
> between the
> extension and the device from a sqlite db. So for example I can get
> Zap/17 from the entry for 200 in the db. I now want to extend this
> functionality to hints.
>
> The reason for doing this is so that I can have a dialplan which
> doesn't
> change - only the database changes. This makes it much easier from the
> perspective of doing configuration from (eg) a web interface.
You really want to think hard about the architecture for this.
Consider that
we consult the hint list for every change during every call, many times
per call. Adding all those database lookups may seriously affect
your server.
AGI is not what you want, realtime is more close to target.
I think we should look into having a preload of only hints from realtime
and keep them in memory, then having manager and CLI commands
to remove/add hints or force a reload of the hints from database
while running.
I know that Tilghman has been working on this, so check his work.
It's not a lot of memory consumption to keep them in memory,
and it saves a *lot* of database processing.
/O
More information about the asterisk-dev
mailing list