summaryrefslogtreecommitdiff
path: root/channels/chan_unistim.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-10-02 16:23:34 +0000
committerJoshua Colp <jcolp@digium.com>2013-10-02 16:23:34 +0000
commitc1235f2639023a9e450cafcdf8bd35cc304d9e53 (patch)
treeb48cb7bb27925ff48e4f807dda8ee9588fd36031 /channels/chan_unistim.c
parent424c0f2eb7ff45a06a21b2d81532ac49e24e8b60 (diff)
Reduce channel snapshot creation and publishing by up to 50%.
This change introduces the ability to stage channel snapshot creation and publishing by suppressing the implicit creation and publishing that some functions have. Once all operations are executed the staging is marked as done and a single snapshot is created and published. Review: https://reviewboard.asterisk.org/r/2889/ ........ Merged revisions 400265 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_unistim.c')
-rw-r--r--channels/chan_unistim.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c
index adb5cb9c8..523867988 100644
--- a/channels/chan_unistim.c
+++ b/channels/chan_unistim.c
@@ -77,7 +77,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/astdb.h"
#include "asterisk/features_config.h"
#include "asterisk/bridge.h"
-
+#include "asterisk/stasis_channels.h"
#define DEFAULTCONTEXT "default"
#define DEFAULTCALLERID "Unknown"
@@ -5563,6 +5563,8 @@ static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state
return NULL;
}
+ ast_channel_stage_snapshot(tmp);
+
ast_format_cap_copy(ast_channel_nativeformats(tmp), l->cap);
if (ast_format_cap_is_empty(ast_channel_nativeformats(tmp))) {
ast_format_cap_copy(ast_channel_nativeformats(tmp), global_cap);
@@ -5623,6 +5625,9 @@ static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state
}
}
ast_channel_priority_set(tmp, 1);
+
+ ast_channel_stage_snapshot_done(tmp);
+
if (state != AST_STATE_DOWN) {
if (unistimdebug) {
ast_verb(0, "Starting pbx in unistim_new\n");