[asterisk-commits] russell: branch russell/events r74110 - /team/russell/events/main/devicestate.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jul 9 13:03:25 CDT 2007
Author: russell
Date: Mon Jul 9 13:03:24 2007
New Revision: 74110
URL: http://svn.digium.com/view/asterisk?view=rev&rev=74110
Log:
disable pulling the last known device state from the cache, and comment on why
Modified:
team/russell/events/main/devicestate.c
Modified: team/russell/events/main/devicestate.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/devicestate.c?view=diff&rev=74110&r1=74109&r2=74110
==============================================================================
--- team/russell/events/main/devicestate.c (original)
+++ team/russell/events/main/devicestate.c Mon Jul 9 13:03:24 2007
@@ -262,6 +262,15 @@
return res;
}
+/* The last known device state is cached. However, this can't be enabled until
+ * we are confident that the cache contains the correct value. There are some
+ * places that this would break. For example, chan_agent previously never called
+ * ast_device_state_changed() when an agent's state changed to BUSY. It only
+ * worked because app_queue polled for the device state, which made it call into
+ * the channel driver on a regular basis. chan_agent now explicitly changes state
+ * to busy, but I'd like to review all of the channel drivers before enabling use
+ * of the cache. */
+#if 0
static enum ast_device_state devstate_cached(const char *device)
{
enum ast_device_state res = AST_DEVICE_UNKNOWN;
@@ -280,6 +289,7 @@
return res;
}
+#endif
/*! \brief Check device state through channel specific function or generic function */
enum ast_device_state ast_device_state(const char *device)
@@ -293,10 +303,13 @@
/*! \brief Another provider of device state */
char *provider = NULL;
+ /* See comment by devstate_cached */
+#if 0
/* If the last known state is cached, just return that */
res = devstate_cached(device);
if (res != AST_DEVICE_UNKNOWN)
return res;
+#endif
buf = ast_strdupa(device);
tech = strsep(&buf, "/");
More information about the asterisk-commits
mailing list