core: Cleanup some channel snapshot staging anomalies.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 8 Feb 2017 20:27:18 +0000 (14:27 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 10 Feb 2017 18:05:56 +0000 (12:05 -0600)
commit16fdb11bc3bb23a2fd645a24a7ba56d9708960ff
treef103d60ec16e977d3fe9d92762ac37894a3b593e
parent46147a8f3013ba7fcf326e1b2d6e1b6c4ad68202
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
apps/app_dial.c
channels/chan_sip.c
main/channel.c
main/rtp_engine.c