From 388e8bd9a8011da13014fdd1734834609a85b67c Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Mon, 29 Aug 2005 23:53:29 +0000 Subject: massive upgrade to SUBSCRIBE, device state and messaging support (issue #3644) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6446 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/pbx.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h index d54d3ef8e..f36d971bf 100755 --- a/include/asterisk/pbx.h +++ b/include/asterisk/pbx.h @@ -42,11 +42,26 @@ enum ast_extension_states { /*! No device INUSE or BUSY */ AST_EXTENSION_NOT_INUSE = 0, /*! One or more devices INUSE */ - AST_EXTENSION_INUSE = 1, + AST_EXTENSION_INUSE = 1 << 0, /*! All devices BUSY */ - AST_EXTENSION_BUSY = 2, + AST_EXTENSION_BUSY = 1 << 1, /*! All devices UNAVAILABLE/UNREGISTERED */ - AST_EXTENSION_UNAVAILABLE = 3, + AST_EXTENSION_UNAVAILABLE = 1 << 2, + /*! All devices RINGING */ + AST_EXTENSION_RINGING = 1 << 3, +}; + + +static const struct cfextension_states { + int extension_state; + const char * const text; +} extension_states[] = { + { AST_EXTENSION_NOT_INUSE, "Idle" }, + { AST_EXTENSION_INUSE, "InUse" }, + { AST_EXTENSION_BUSY, "Busy" }, + { AST_EXTENSION_UNAVAILABLE, "Unavailable" }, + { AST_EXTENSION_RINGING, "Ringing" }, + { AST_EXTENSION_INUSE | AST_EXTENSION_RINGING, "InUse&Ringing" } }; struct ast_context; @@ -257,6 +272,13 @@ int ast_unregister_application(const char *app); */ int ast_extension_state(struct ast_channel *c, char *context, char *exten); +/*! Return string of the state of an extension */ +/*! + * \param extension_state is the numerical state delivered by ast_extension_state + * Returns the state of an extension as string + */ +const char *ast_extension_state2str(int extension_state); + /*! Registers a state change callback */ /*! * \param context which context to look in -- cgit v1.2.3