]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_stasis: Add control ref to playback and recording structs. 09/2509/1
authorRichard Mudgett <rmudgett@digium.com>
Tue, 29 Mar 2016 18:47:08 +0000 (13:47 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 30 Mar 2016 21:23:40 +0000 (16:23 -0500)
commitecf4102d02db03923adfcce7408ab25c3fdbb7c1
treec2d090f6d6c06bcbb99e59f332a8d8f5adfb12f8
parenta179aba65e117afb6480d8396e92df2e5d2d4628
res_stasis: Add control ref to playback and recording structs.

The stasis_app_playback and stasis_app_recording structs need to have a
struct stasis_app_control ref.  Other threads can get a reference to the
playback and recording structs from their respective global container.
These other threads can then use the control pointer they contain after
the control struct has gone.

* Add control ref to stasis_app_playback and stasis_app_recording structs.

With the refs added, the control command queue can now have a circular
control reference which will cause the control struct to never get
released if the control's command queue is not flushed when the channel
leaves the Stasis application.  Also the command queue needs better
protection from adding commands if the control->is_done flag is set.

* Flush the control command queue on exit.

ASTERISK-25882 #close

Change-Id: I3cf1fb59cbe6f50f20d9e35a2c07ac07d7f4320d
include/asterisk/stasis_app.h
res/ari/resource_bridges.c
res/res_stasis.c
res/res_stasis_playback.c
res/res_stasis_recording.c
res/stasis/control.c
res/stasis/control.h