Sat Aug 6 00:40:09 2011

Asterisk developer's documentation


sip_extenstate_updates Struct Reference

list of extension state updates for the dialog list. More...


Data Fields

sip_extenstate_updatefirst
sip_extenstate_updatelast
ast_mutex_t lock


Detailed Description

list of extension state updates for the dialog list.

Note:
This list deserves a detailed explanation as to why it was created and why it is necessary... So here it is.
When an endpoint SUBSCRIBES to the state of a hint a callback function is registered with the Asterisk core. That callback is used to notify chan_sip every time that hint's state changes and what endpoint we need to update. The problem occurs with the locking order used during that callback function. When the function is used by the Asterisk core, the global contexts lock is held. Then within the callback the sip_pvt lock is held. That completely invalidates the locking order used everywhere else in chan_sip regarding these two locks. Typically the pvt lock is held while we ask the Asterisk core about an extension and context which results in the context being locked. In order to avoid the possible deadlock that could occur in the callback function due to improper locking, this list was created to queue those state changes for the sip_pvt to read outside of that thread. This way the context lock never has to be held before the pvt lock is held.

Definition at line 1303 of file chan_sip.c.


Field Documentation

struct sip_extenstate_update* first

Definition at line 1303 of file chan_sip.c.

struct sip_extenstate_update* last

Definition at line 1303 of file chan_sip.c.

ast_mutex_t lock

Definition at line 1303 of file chan_sip.c.


The documentation for this struct was generated from the following file:
Generated on Sat Aug 6 00:40:09 2011 for Asterisk - the Open Source PBX by  doxygen 1.4.7