]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_stasis_playback: Send PlaybackFinish event only once for errors
authorAndre Barbosa <andre.emanuel.barbosa@gmail.com>
Fri, 4 Jun 2021 11:11:10 +0000 (12:11 +0100)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Thu, 24 Jun 2021 13:54:20 +0000 (08:54 -0500)
commit884d863c089f19ba07edfdf441cb521df0eb07a5
treea49863bcf8889bef5d59e4206d9b9973a08e3f47
parent987eb8a5eae2549856b60e3619e7acb6c63f3a49
res_stasis_playback: Send PlaybackFinish event only once for errors

When we try to play a list of sound files in the same Play command,
we get only one PlaybackFinish event, after all sounds are played.

But in the case where the Play fails (because channel is destroyed
for example), Asterisk will send one PlaybackFinish event for each
sound file still to be played. If the list is big, Asterisk is
sending many events.

This patch adds a failed state so we can understand that the play
failed. On that case we don't send the event, if we still have a
list of sounds to be played.

When we reach the last sound, we send the PlaybackFinish with
the failed state.

ASTERISK-29464 #close

Change-Id: I4c2e5921cc597702513af0d7c6c2c982e1798322
doc/CHANGES-staging/res_stasis_playback.txt [new file with mode: 0644]
include/asterisk/stasis_app_playback.h
res/res_stasis_playback.c
rest-api/api-docs/playbacks.json