diff options
author | Mark Michelson <mmichelson@digium.com> | 2012-06-04 20:26:12 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2012-06-04 20:26:12 +0000 |
commit | 14a985560ed5830aa3e1b5880890a59a5d0f0c2f (patch) | |
tree | 4d6f57c4358566c5508d79e97560640ce59df5c8 /include/asterisk/pbx.h | |
parent | c1bbe79748bb1615ab116fe287b8d5d28a83b330 (diff) |
Merge changes dealing with support for Digium phones.
Presence support has been added. This is accomplished by
allowing for presence hints in addition to device state
hints. A dialplan function called PRESENCE_STATE has been
added to allow for setting and reading presence. Presence
can be transmitted to Digium phones using custom XML
elements in a PIDF presence document.
Voicemail has new APIs that allow for moving, removing,
forwarding, and playing messages. Messages have had a new
unique message ID added to them so that the APIs will work
reliably. The state of a voicemail mailbox can be obtained
using an API that allows one to get a snapshot of the mailbox.
A voicemail Dialplan App called VoiceMailPlayMsg has been
added to be able to play back a specific message.
Configuration hooks have been added. Configuration hooks
allow for a piece of code to be executed when a specific
configuration file is loaded by a specific module. This is
useful for modules that are dependent on the configuration
of other modules.
chan_sip now has a public method that allows for a custom
SIP INFO request to be sent mid-dialog. Digium phones use
this in order to display progress bars when files are played.
Messaging support has been expanded a bit. The main
visible difference is the addition of an AMI action
MessageSend.
Finally, a ParkingLots manager action has been added in order
to get a list of parking lots.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/pbx.h')
-rw-r--r-- | include/asterisk/pbx.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h index f7dc7b919..2305f3910 100644 --- a/include/asterisk/pbx.h +++ b/include/asterisk/pbx.h @@ -26,6 +26,7 @@ #include "asterisk/channel.h" #include "asterisk/sched.h" #include "asterisk/devicestate.h" +#include "asterisk/presencestate.h" #include "asterisk/chanvars.h" #include "asterisk/hashtab.h" #include "asterisk/stringfields.h" @@ -74,9 +75,24 @@ struct ast_exten; struct ast_include; struct ast_ignorepat; struct ast_sw; + +enum ast_state_cb_update_reason { + /*! The extension state update is a result of a device state changing on the extension. */ + AST_HINT_UPDATE_DEVICE = 1, + /*! The extension state update is a result of presence state changing on the extension. */ + AST_HINT_UPDATE_PRESENCE = 2, +}; + +struct ast_state_cb_info { + enum ast_state_cb_update_reason reason; + enum ast_extension_states exten_state; + enum ast_presence_state presence_state; + const char *presence_subtype; + const char *presence_message; +}; /*! \brief Typedef for devicestate and hint callbacks */ -typedef int (*ast_state_cb_type)(const char *context, const char *exten, enum ast_extension_states state, void *data); +typedef int (*ast_state_cb_type)(char *context, char *id, struct ast_state_cb_info *info, void *data); /*! \brief Typedef for devicestate and hint callback removal indication callback */ typedef void (*ast_state_cb_destroy_type)(int id, void *data); @@ -402,6 +418,22 @@ enum ast_extension_states ast_devstate_to_extenstate(enum ast_device_state devst int ast_extension_state(struct ast_channel *c, const char *context, const char *exten); /*! + * \brief Uses hint and presence state callback to get the presence state of an extension + * + * \param c this is not important + * \param context which context to look in + * \param exten which extension to get state + * \param[out] subtype Further information regarding the presence returned + * \param[out] message Custom message further describing current presence + * + * \note The subtype and message are dynamically allocated and must be freed by + * the caller of this function. + * + * \return returns the presence state value. + */ +int ast_hint_presence_state(struct ast_channel *c, const char *context, const char *exten, char **subtype, char **message); + +/*! * \brief Return string representation of the state of an extension * * \param extension_state is the numerical state delivered by ast_extension_state |