[Asterisk-code-review] res/res stasis playback: Cancel the entire playlist when a s... (asterisk[14.0])

Joshua Colp asteriskteam at digium.com
Wed Sep 7 18:16:02 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: res/res_stasis_playback: Cancel the entire playlist when a stop occurs
......................................................................


res/res_stasis_playback: Cancel the entire playlist when a stop occurs

Prior to this patch, a stop issued by a delete of a Playback resource
(indicated by the control frame AST_CONTROL_STREAM_STOP) would only stop
the current media URI playing. Subsequent URIs specified by a playback
operation would then proceed on, even though we had just indicated to
the User that the Playback was finished *and* after they had just
'deleted' the resource. Whoops.

This patch corrects it by bailing out of the sequence of URIs to play if
one of them is terminated with an AST_CONTROL_STREAM_STOP indication.

ASTERISK-26341 #close

Change-Id: I2da9ec43545ba46cdfffe287c7e4907eae7fca42
---
M res/res_stasis_playback.c
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve; Verified



diff --git a/res/res_stasis_playback.c b/res/res_stasis_playback.c
index a64ecff..cfddb3a 100644
--- a/res/res_stasis_playback.c
+++ b/res/res_stasis_playback.c
@@ -370,6 +370,9 @@
 
 		playback_final_update(playback, offsetms, res,
 			ast_channel_uniqueid(chan));
+		if (res == AST_CONTROL_STREAM_STOP) {
+			break;
+		}
 
 		/* Reset offset for any subsequent media */
 		offsetms = 0;

-- 
To view, visit https://gerrit.asterisk.org/3836
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2da9ec43545ba46cdfffe287c7e4907eae7fca42
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14.0
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list