From c1235f2639023a9e450cafcdf8bd35cc304d9e53 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Wed, 2 Oct 2013 16:23:34 +0000 Subject: 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 --- channels/sig_pri.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'channels/sig_pri.c') diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 9f4007723..5def34c23 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -6473,6 +6473,7 @@ static void *pri_dchannel(void *vpri) ast_mutex_lock(&pri->lock); sig_pri_lock_private(pri->pvts[chanpos]); if (c) { + ast_channel_stage_snapshot(c); #if defined(HAVE_PRI_SUBADDR) if (e->ring.calling.subaddress.valid) { /* Set Calling Subaddress */ @@ -6557,6 +6558,7 @@ static void *pri_dchannel(void *vpri) PVT_TO_CHANNEL(pri->pvts[chanpos]), 1); #endif } + ast_channel_stage_snapshot_done(c); } if (c && !ast_pthread_create_detached(&threadid, NULL, pri_ss_thread, pri->pvts[chanpos])) { ast_verb(3, "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n", @@ -6602,6 +6604,7 @@ static void *pri_dchannel(void *vpri) * will do anything with the channel we have just * created. */ + ast_channel_stage_snapshot(c); #if defined(HAVE_PRI_SUBADDR) if (e->ring.calling.subaddress.valid) { /* Set Calling Subaddress */ @@ -6670,6 +6673,8 @@ static void *pri_dchannel(void *vpri) sig_pri_handle_subcmds(pri, chanpos, e->e, e->ring.subcmds, e->ring.call); + + ast_channel_stage_snapshot_done(c); } if (c && !ast_pbx_start(c)) { ast_verb(3, "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n", -- cgit v1.2.3