diff options
author | Joshua Colp <jcolp@digium.com> | 2013-10-02 16:23:34 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2013-10-02 16:23:34 +0000 |
commit | c1235f2639023a9e450cafcdf8bd35cc304d9e53 (patch) | |
tree | b48cb7bb27925ff48e4f807dda8ee9588fd36031 /channels/chan_console.c | |
parent | 424c0f2eb7ff45a06a21b2d81532ac49e24e8b60 (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_console.c')
-rw-r--r-- | channels/chan_console.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_console.c b/channels/chan_console.c index 0f4d01ebd..76571d209 100644 --- a/channels/chan_console.c +++ b/channels/chan_console.c @@ -76,6 +76,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/musiconhold.h" #include "asterisk/callerid.h" #include "asterisk/astobj2.h" +#include "asterisk/stasis_channels.h" /*! * \brief The sample rate to request from PortAudio @@ -427,6 +428,8 @@ static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext, return NULL; } + ast_channel_stage_snapshot(chan); + ast_channel_tech_set(chan, &console_tech); ast_format_set(ast_channel_readformat(chan), AST_FORMAT_SLINEAR16, 0); ast_format_set(ast_channel_writeformat(chan), AST_FORMAT_SLINEAR16, 0); @@ -440,6 +443,8 @@ static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext, ast_jb_configure(chan, &global_jbconf); + ast_channel_stage_snapshot_done(chan); + if (state != AST_STATE_DOWN) { if (ast_pbx_start(chan)) { ast_channel_hangupcause_set(chan, AST_CAUSE_SWITCH_CONGESTION); |