[Asterisk-code-review] say: Abort play loop if caller hangs up. (asterisk[16])

N A asteriskteam at digium.com
Wed Jun 22 05:09:01 CDT 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18713 )


Change subject: say: Abort play loop if caller hangs up.
......................................................................

say: Abort play loop if caller hangs up.

If the caller has hung up, break out of the play loop so we don't try
to play remaining files and fail to do so.

ASTERISK-30075 #close

Change-Id: I55e85be28ee90b48c0fe4ce20ac136a7dbb49f14
---
M main/say.c
1 file changed, 3 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/13/18713/1

diff --git a/main/say.c b/main/say.c
index 27a5eda..28fe944 100644
--- a/main/say.c
+++ b/main/say.c
@@ -189,19 +189,13 @@
 
 	files = ast_str_buffer(filenames);
 
-	while ((fn = strsep(&files, "&"))) {
+	while (!res && (fn = strsep(&files, "&"))) {
 		res = ast_streamfile(chan, fn, lang);
 		if (!res) {
-			if ((audiofd  > -1) && (ctrlfd > -1))
+			if ((audiofd  > -1) && (ctrlfd > -1)) {
 				res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
-			else
+			} else {
 				res = ast_waitstream(chan, ints);
-
-			if (res > 0) {
-				/* We were interrupted by a digit */
-				ast_stopstream(chan);
-				ast_free(filenames);
-				return res;
 			}
 		}
 		ast_stopstream(chan);

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18713
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I55e85be28ee90b48c0fe4ce20ac136a7dbb49f14
Gerrit-Change-Number: 18713
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220622/462bcbf4/attachment-0001.html>


More information about the asterisk-code-review mailing list