![]() |
Home page |
Mailing list |
Docs
The device state is basically based on the current calls. If the devicestate engine can find a call from or to the device, it's in use.
Some channel drivers implement a callback function for a better level of reporting device states. The SIP channel has a complicated system for this, which is improved by adding call limits to the configuration.
Functions that want to check the status of an extension register themself as a watcher. Watchers in this system can subscribe either to all extensions or just a specific extensions.
For non-device related states, there's an API called devicestateproviders. This is an extendable system for delivering state information from outside sources or functions within Asterisk. Currently we have providers for app_meetme.c - the conference bridge - and call parking (metermaids).
There are manly three subscribers to extension states within Asterisk:
The CLI command "show hints" show last known state
The changes are queued and processed by a separate thread. This thread calls the watchers subscribing to status changes for the object. For manager, this results in events. For SIP, NOTIFY requests.
Asterisk developer's documentation :: Codename Pineapple
Extension and device states in Asterisk
Asterisk has an internal system that reports states for an extension. By using the dialplan priority -1, also called a hint, a connection can be made from an extension to one or many devices. The state of the extension now depends on the combined state of the devices.
Architecture for devicestates
When a channel driver or asterisk app changes state for a watched object, it alerts the core. The core queues a change. When the change is processed, there's a query sent to the channel driver/provider if there's a function to handle that, otherwise a channel walk is issued to find a channel that involves the object.
Architecture for extension states
Hints are connected to extension. If an extension changes state it checks the hint devices. If there is a hint, the callbacks into device states are checked. The aggregated state is set for the hint and reported back.
Asterisk is a trademark for Digium, inc.. | Edvina.net | Asterisk.org | This documentation was generated with Doxygen