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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2013-10-02 16:20:25 +00:00
parent 1e22b90efe
commit 1dd63fbdfa
22 changed files with 151 additions and 3 deletions

View File

@@ -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",