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/app.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/app.h')
-rw-r--r-- | include/asterisk/app.h | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h index edf1c1c37..d438790e3 100644 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -23,8 +23,10 @@ #ifndef _ASTERISK_APP_H #define _ASTERISK_APP_H +#include "asterisk/stringfields.h" #include "asterisk/strings.h" #include "asterisk/threadstorage.h" +#include "asterisk/file.h" struct ast_flags64; @@ -77,6 +79,27 @@ struct ast_ivr_menu { unsigned int flags; /*!< Flags */ struct ast_ivr_option *options; /*!< All options */ }; + +/*! + * \brief Structure used for ast_copy_recording_to_vm in order to cleanly supply + * data needed for making the recording from the recorded file. + */ +struct ast_vm_recording_data { + AST_DECLARE_STRING_FIELDS( + AST_STRING_FIELD(context); + AST_STRING_FIELD(mailbox); + AST_STRING_FIELD(folder); + AST_STRING_FIELD(recording_file); + AST_STRING_FIELD(recording_ext); + + AST_STRING_FIELD(call_context); + AST_STRING_FIELD(call_macrocontext); + AST_STRING_FIELD(call_extension); + AST_STRING_FIELD(call_callerchan); + AST_STRING_FIELD(call_callerid); + ); + int call_priority; +}; #define AST_IVR_FLAG_AUTORESTART (1 << 0) @@ -219,11 +242,21 @@ void ast_install_vm_functions(int (*has_voicemail_func)(const char *mailbox, con int (*inboxcount_func)(const char *mailbox, int *newmsgs, int *oldmsgs), int (*inboxcount2_func)(const char *mailbox, int *urgentmsgs, int *newmsgs, int *oldmsgs), int (*messagecount_func)(const char *context, const char *mailbox, const char *folder), - int (*sayname_func)(struct ast_channel *chan, const char *mailbox, const char *context)); + int (*sayname_func)(struct ast_channel *chan, const char *mailbox, const char *context), + int (*copy_recording_to_vm_func)(struct ast_vm_recording_data *vm_rec_data)); + void ast_uninstall_vm_functions(void); /*! + * \brief + * param[in] vm_rec_data Contains data needed to make the recording. + * retval 0 voicemail successfully created from recording. + * retval -1 Failure + */ +int ast_app_copy_recording_to_vm(struct ast_vm_recording_data *vm_rec_data); + +/*! * \brief Determine if a given mailbox has any voicemail * If folder is NULL, defaults to "INBOX". If folder is "INBOX", includes the * number of messages in the "Urgent" folder. @@ -339,6 +372,29 @@ int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, in */ int ast_control_streamfile(struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *pause, const char *restart, int skipms, long *offsetms); +/*! + * \brief Stream a file with fast forward, pause, reverse, restart. + * \param chan + * \param file filename + * \param fwd, rev, stop, pause, restart, skipms, offsetms + * \param waitstream callback to invoke when fastforward or rewind occurrs. + * + * Before calling this function, set this to be the number + * of ms to start from the beginning of the file. When the function + * returns, it will be the number of ms from the beginning where the + * playback stopped. Pass NULL if you don't care. + */ +int ast_control_streamfile_w_cb(struct ast_channel *chan, + const char *file, + const char *fwd, + const char *rev, + const char *stop, + const char *pause, + const char *restart, + int skipms, + long *offsetms, + ast_waitstream_fr_cb cb); + /*! \brief Play a stream and wait for a digit, returning the digit that was pressed */ int ast_play_and_wait(struct ast_channel *chan, const char *fn); |