summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2017-02-08 14:27:18 -0600
committerRichard Mudgett <rmudgett@digium.com>2017-02-10 12:05:48 -0600
commitf88b598ca2be64fcbd9fa4f5b8241612b7c076be (patch)
tree9ce30dc785a2d470afa60ef017a768ad82daff52 /channels/chan_sip.c
parent8a528abe9e91df749b2ce7c276b98ce850df855b (diff)
core: Cleanup some channel snapshot staging anomalies.
We shouldn't unlock the channel after starting a snapshot staging because another thread may interfere and do its own snapshot staging. * app_dial.c:dial_exec_full() made hold the channel lock while setting up the outgoing channel staging. Made hold the channel lock after the called party answers while updating the caller channel staging. * chan_sip.c:sip_new() completed the channel staging on off-nominal exit. Also we need to use ast_hangup() instead of ast_channel_unref() at that location. * channel.c:__ast_channel_alloc_ap() added a comment about not needing to complete the channel snapshot staging on off-nominal exit paths. * rtp_engine.c:ast_rtp_instance_set_stats_vars() made hold the channel locks while staging the channels for the stats channel variables. Change-Id: Iefb6336893163f6447bad65568722ad5d5d8212a
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 709d5ab45..0622a92ce 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8148,7 +8148,9 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
if (!fmt) {
ast_log(LOG_WARNING, "No compatible formats could be found for %s\n", ast_channel_name(tmp));
ao2_ref(caps, -1);
- tmp = ast_channel_unref(tmp);
+ ast_channel_stage_snapshot_done(tmp);
+ ast_channel_unlock(tmp);
+ ast_hangup(tmp);
return NULL;
}
}