summaryrefslogtreecommitdiff
path: root/channels/sig_pri.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/sig_pri.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/sig_pri.c')
-rw-r--r--channels/sig_pri.c5
1 files changed, 5 insertions, 0 deletions
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",