}
/*! \brief Check device state through channel specific function or generic function */
-enum ast_device_state ast_device_state(const char *device)
+static enum ast_device_state _ast_device_state(const char *device, int check_cache)
{
char *buf;
char *number;
return res;
}
+enum ast_device_state ast_device_state(const char *device)
+{
+ /* This function is called from elsewhere in the code to find out the
+ * current state of a device. Check the cache, first. */
+
+ return _ast_device_state(device, 1);
+}
+
/*! \brief Add device state provider */
int ast_devstate_prov_add(const char *label, ast_devstate_prov_cb_type callback)
{
{
enum ast_device_state state;
- state = ast_device_state(device);
+ state = _ast_device_state(device, 0);
ast_debug(3, "Changing state for %s - state %d (%s)\n", device, state, devstate2str(state));