aboutsummaryrefslogtreecommitdiffstats
path: root/main/devicestate.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-26 14:57:50 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-26 14:57:50 +0000
commite7f57f6eedfc64f905f0fd204e04b954cd286b8b (patch)
tree8c7bfa80376d370d234e94cbf6d8365b1d89c98b /main/devicestate.c
parenta269115f5fc49902bf21f73af7d4492b551a9a63 (diff)
Re-work comment about how device state changes are processed to be a bit more clear
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@133943 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/devicestate.c')
-rw-r--r--main/devicestate.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/main/devicestate.c b/main/devicestate.c
index 9a2881a3f..b27413cfb 100644
--- a/main/devicestate.c
+++ b/main/devicestate.c
@@ -476,12 +476,21 @@ int ast_devstate_changed_literal(enum ast_device_state state, const char *device
{
struct state_change *change;
- /* If we know the state change (how nice of the caller of this function!)
- * then we can just generate the event. Otherwise, we have to go through
- * a crap ton of extra work to go figure out what the state change is.
- * We queue the fact that the state has changed up for another thread to
- * go figure out, which it does by calling into the channel driver if it
- * can, or by walking through the active channel list. */
+ /*
+ * If we know the state change (how nice of the caller of this function!)
+ * then we can just generate a device state event.
+ *
+ * Otherwise, we do the following:
+ * - Queue an event up to another thread that the state has changed
+ * - In the processing thread, it calls the callback provided by the
+ * device state provider (which may or may not be a channel driver)
+ * to determine the state.
+ * - If the device state provider does not know the state, or this is
+ * for a channel and the channel driver does not implement a device
+ * state callback, then we will look through the channel list to
+ * see if we can determine a state based on active calls.
+ * - Once a state has been determined, a device state event is generated.
+ */
if (state != AST_DEVICE_UNKNOWN) {
devstate_event(device, state);