Skip to content

Commit 0f0cc43

Browse files
InterLinked1Friendly Automation
authored andcommitted
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
1 parent a3b2daf commit 0f0cc43

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

main/say.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,13 @@ static int say_filenames(struct ast_channel *chan, const char *ints, const char
189189

190190
files = ast_str_buffer(filenames);
191191

192-
while ((fn = strsep(&files, "&"))) {
192+
while (!res && (fn = strsep(&files, "&"))) {
193193
res = ast_streamfile(chan, fn, lang);
194194
if (!res) {
195-
if ((audiofd > -1) && (ctrlfd > -1))
195+
if ((audiofd > -1) && (ctrlfd > -1)) {
196196
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
197-
else
197+
} else {
198198
res = ast_waitstream(chan, ints);
199-
200-
if (res > 0) {
201-
/* We were interrupted by a digit */
202-
ast_stopstream(chan);
203-
ast_free(filenames);
204-
return res;
205199
}
206200
}
207201
ast_stopstream(chan);

0 commit comments

Comments
 (0)