Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Stasis Application Device State API. See StasisApplication API" for detailed documentation. More...
Go to the source code of this file.
enum stasis_device_state_result | stasis_app_device_state_delete (const char *name) |
Delete a device controlled by ARI. More... | |
struct ast_json * | stasis_app_device_state_to_json (const char *name, enum ast_device_state state) |
Convert device state to json. More... | |
enum stasis_device_state_result | stasis_app_device_state_update (const char *name, const char *value) |
Changes the state of a device controlled by ARI. More... | |
struct ast_json * | stasis_app_device_states_to_json (void) |
Convert device states to json array. More... | |
enum | stasis_device_state_result { STASIS_DEVICE_STATE_OK , STASIS_DEVICE_STATE_NOT_CONTROLLED , STASIS_DEVICE_STATE_MISSING , STASIS_DEVICE_STATE_UNKNOWN , STASIS_DEVICE_STATE_SUBSCRIBERS } |
Stasis Application Device State API. See StasisApplication API" for detailed documentation.
Definition in file stasis_app_device_state.h.
Stasis device state application result codes
Definition at line 56 of file stasis_app_device_state.h.
enum stasis_device_state_result stasis_app_device_state_delete | ( | const char * | name | ) |
Delete a device controlled by ARI.
name | the name of the ARI controlled device |
Definition at line 244 of file res_stasis_device_state.c.
References ast_db_del(), ast_device_state_clear_cache(), AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_log, ast_strlen_zero(), DEVICE_STATE_FAMILY, DEVICE_STATE_SCHEME_STASIS, LOG_ERROR, name, STASIS_DEVICE_STATE_MISSING, STASIS_DEVICE_STATE_NOT_CONTROLLED, STASIS_DEVICE_STATE_OK, and STASIS_DEVICE_STATE_UNKNOWN.
Referenced by ast_ari_device_states_delete().
struct ast_json * stasis_app_device_state_to_json | ( | const char * | name, |
enum ast_device_state | state | ||
) |
Convert device state to json.
name | the name of the device |
state | the device state |
NULL | on error. |
Definition at line 160 of file res_stasis_device_state.c.
References ast_devstate_str(), ast_json_pack(), and name.
Referenced by ast_ari_device_states_get(), send_device_state(), and stasis_app_device_states_to_json().
enum stasis_device_state_result stasis_app_device_state_update | ( | const char * | name, |
const char * | value | ||
) |
Changes the state of a device controlled by ARI.
name | the name of the ARI controlled device |
value | a valid device state value |
Definition at line 211 of file res_stasis_device_state.c.
References ast_db_put(), ast_debug, AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_devstate_val(), ast_log, ast_strlen_zero(), DEVICE_STATE_FAMILY, DEVICE_STATE_SCHEME_STASIS, LOG_ERROR, name, STASIS_DEVICE_STATE_MISSING, STASIS_DEVICE_STATE_NOT_CONTROLLED, STASIS_DEVICE_STATE_OK, STASIS_DEVICE_STATE_UNKNOWN, state, and value.
Referenced by ast_ari_device_states_update().
struct ast_json * stasis_app_device_states_to_json | ( | void | ) |
Convert device states to json array.
NULL | on error. |
Definition at line 168 of file res_stasis_device_state.c.
References array(), ast_db_freetree(), ast_db_gettree(), ast_json_array_append(), ast_json_array_create(), ast_strlen_zero(), DEVICE_STATE_FAMILY, DEVICE_STATE_SCHEME_STASIS, DEVICE_STATE_SIZE, entry::key, name, NULL, and stasis_app_device_state_to_json().
Referenced by ast_ari_device_states_list().