[asterisk-users] Discover Asterisk 1.4 :: SIP Subscriptions

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Tue Jan 15 13:07:57 CST 2008


On Tuesday 15 January 2008 12:13:46 Atis Lezdins wrote:
> On 1/15/08, Tilghman Lesher <tilghman at mail.jeffandtilghman.com> wrote:
> > Having a hint entry is only half the battle.  The other half is in
> > keeping a registry of function pointers to call when the state of the
> > device changes.
>
> I'm not very familiar with internal structure of device states,
> however i think this is not so hard. Why would you need to keep a
> registry, i think you should just do SELECT whenever any device state
> changes, to find out what to update.

No, you need the REVERSE direction.  You need to know what code to notify
when the device changes (the device does not need to know that its state
changed -- the device is what *initiated* the state change).

And that code is not always specifically pointing to a device.  In some cases,
the code is notifying an application that a device changed, which is why it's
a function pointer callback that is registered to the device hint.

-- 
Tilghman



More information about the asterisk-users mailing list