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
This commit is contained in:
Kevin P. Fleming
2005-08-29 23:53:29 +00:00
parent b42b25b521
commit 388e8bd9a8
3 changed files with 415 additions and 122 deletions

View File

@@ -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