[asterisk-commits] dlee: branch dlee/playback-rebase r388903 - in /team/dlee/playback-rebase: ./...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 15 16:18:40 CDT 2013
Author: dlee
Date: Wed May 15 16:18:38 2013
New Revision: 388903
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388903
Log:
Merged revisions 388818-388896 from http://svn.asterisk.org/svn/asterisk/trunk
Modified:
team/dlee/playback-rebase/ (props changed)
team/dlee/playback-rebase/apps/app_voicemail.c
team/dlee/playback-rebase/main/lock.c
team/dlee/playback-rebase/res/stasis/app.c
team/dlee/playback-rebase/res/stasis/app.h
Propchange: team/dlee/playback-rebase/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/dlee/playback-rebase/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 15 16:18:38 2013
@@ -1,1 +1,1 @@
-/trunk:1-388812
+/trunk:1-388896
Modified: team/dlee/playback-rebase/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/apps/app_voicemail.c?view=diff&rev=388903&r1=388902&r2=388903
==============================================================================
--- team/dlee/playback-rebase/apps/app_voicemail.c (original)
+++ team/dlee/playback-rebase/apps/app_voicemail.c Wed May 15 16:18:38 2013
@@ -15118,24 +15118,20 @@
mailbox_snapshot->folders = ARRAY_LEN(mailbox_folders);
for (i = 0; i < mailbox_snapshot->folders; i++) {
- int combining_old = 0;
- /* Assume we are combining folders if:
- * - The current index is the old folder index OR
- * - The current index is urgent and we were looking for INBOX or all folders OR
- * - The current index is INBOX and we were looking for Urgent or all folders
+ int msg_folder_index = i;
+
+ /* We want this message in the snapshot if any of the following:
+ * No folder was specified.
+ * The specified folder matches the current folder.
+ * The specified folder is INBOX AND we were asked to combine messages AND the current folder is either Old or Urgent.
*/
- if ((i == old_index ||
- (i == urgent_index && (this_index_only == inbox_index || this_index_only == -1)) ||
- (i == inbox_index && (this_index_only == urgent_index || this_index_only == -1))) && (combine_INBOX_and_OLD)) {
- combining_old = 1;
- }
-
- /* This if statement is confusing looking. Here is what it means in english.
- * - If a folder is given to the function and that folder's index is not the one we are iterating over, skip it...
- * - Unless the folder provided is the INBOX folder and the current index is the OLD folder and we are combining OLD and INBOX msgs.
- */
- if ((this_index_only != -1) && (this_index_only != i) && !(combining_old && i == old_index && this_index_only == inbox_index)) {
+ if (!(this_index_only == -1 || this_index_only == i || (this_index_only == inbox_index && combine_INBOX_and_OLD && (i == old_index || i == urgent_index)))) {
continue;
+ }
+
+ /* Make sure that Old or Urgent messages are marked as being in INBOX. */
+ if (combine_INBOX_and_OLD && (i == old_index || i == urgent_index)) {
+ msg_folder_index = inbox_index;
}
memset(&vms, 0, sizeof(vms));
@@ -15152,7 +15148,7 @@
/* Iterate through each msg, storing off info */
if (vms.lastmsg != -1) {
- if ((vm_msg_snapshot_create(vmu, &vms, mailbox_snapshot, combining_old ? inbox_index : i, i, descending, sort_val))) {
+ if ((vm_msg_snapshot_create(vmu, &vms, mailbox_snapshot, msg_folder_index, i, descending, sort_val))) {
ast_log(LOG_WARNING, "Failed to create msg snapshots for %s@%s\n", mailbox, context);
goto snapshot_cleanup;
}
Modified: team/dlee/playback-rebase/main/lock.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/main/lock.c?view=diff&rev=388903&r1=388902&r2=388903
==============================================================================
--- team/dlee/playback-rebase/main/lock.c (original)
+++ team/dlee/playback-rebase/main/lock.c Wed May 15 16:18:38 2013
@@ -745,7 +745,7 @@
__ast_mutex_logger("%s line %d (%s): Error destroying rwlock %s: %s\n",
filename, lineno, func, rwlock_name, strerror(res));
}
- if (t->tracking) {
+ if (t->tracking && lt) {
ast_reentrancy_lock(lt);
lt->file[0] = filename;
lt->lineno[0] = lineno;
Modified: team/dlee/playback-rebase/res/stasis/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/res/stasis/app.c?view=diff&rev=388903&r1=388902&r2=388903
==============================================================================
--- team/dlee/playback-rebase/res/stasis/app.c (original)
+++ team/dlee/playback-rebase/res/stasis/app.c Wed May 15 16:18:38 2013
@@ -95,10 +95,7 @@
ast_assert(app != NULL);
uniqueid = ast_channel_uniqueid(chan);
- if (!ast_str_container_add(app->channels, uniqueid)) {
- return -1;
- }
- return 0;
+ return ast_str_container_add(app->channels, uniqueid) ? -1 : 0;
}
void app_remove_channel(struct app* app, const struct ast_channel *chan)
Modified: team/dlee/playback-rebase/res/stasis/app.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback-rebase/res/stasis/app.h?view=diff&rev=388903&r1=388902&r2=388903
==============================================================================
--- team/dlee/playback-rebase/res/stasis/app.h (original)
+++ team/dlee/playback-rebase/res/stasis/app.h Wed May 15 16:18:38 2013
@@ -56,22 +56,83 @@
*/
void app_update(struct app *app, stasis_app_cb handler, void *data);
+/*!
+ * \brief Return an application's name.
+ *
+ * \param app Application.
+ * \return Name of the application.
+ * \return \c NULL is \a app is \c NULL.
+ */
const char *app_name(const struct app *app);
+/*!
+ * \brief Subscribe an application to a topic.
+ *
+ * \param app Application.
+ * \param topic Topic to subscribe to.
+ * \return New subscription.
+ * \return \c NULL on error.
+ */
struct stasis_subscription *app_subscribe(struct app *app,
struct stasis_topic *topic);
+/*!
+ * \brief Send a message to an application.
+ *
+ * \param app Application.
+ * \param message Message to send.
+ */
void app_send(struct app *app, struct ast_json *message);
+/*!
+ * \brief Send the start message to an application.
+ *
+ * \param app Application.
+ * \param chan The channel entering the application.
+ * \param argc The number of arguments for the application.
+ * \param argv The arguments for the application.
+ * \return 0 on success.
+ * \return Non-zero on error.
+ */
int app_send_start_msg(struct app *app, struct ast_channel *chan, int argc,
char *argv[]);
+/*!
+ * \brief Send the end message to an application.
+ *
+ * \param app Application.
+ * \param chan The channel leaving the application.
+ * \return 0 on success.
+ * \return Non-zero on error.
+ */
int app_send_end_msg(struct app *app, struct ast_channel *chan);
+/*!
+ * \brief Checks if an application is watching a given channel.
+ *
+ * \param app Application.
+ * \param uniqueid Uniqueid of the channel to check about.
+ * \return True (non-zero) if \a app is watching channel with given \a uniqueid
+ * \return False (zero) if \a app isn't.
+ */
int app_is_watching_channel(struct app *app, const char *uniqueid);
-int app_add_channel(struct app* app, const struct ast_channel *chan);
+/*!
+ * \brief Add a channel to an application's watch list.
+ *
+ * \param app Application.
+ * \param chan Channel to watch.
+ * \return 0 on success.
+ * \return Non-zero on error.
+ */
+int app_add_channel(struct app *app, const struct ast_channel *chan);
+/*!
+ * \brief Remove a channel from an application's watch list.
+ *
+ * \param app Application.
+ * \param chan Channel to watch.
+ */
void app_remove_channel(struct app *app, const struct ast_channel *chan);
#endif /* _ASTERISK_RES_STASIS_APP_H */
More information about the asterisk-commits
mailing list