Problem faced
On a bridge (with bridge recording on) having a single channel, if I do file audio announcement using play ARI api on the channel, recording on the bridge is getting terminated.
Sequence of Operations
NOTE: everything is done using ARI APIs
Created a bridge on asterisk.
An Incoming call channel is answered (Media flowing both sides).
Added the channel to the bridge and start recording on the bridge. Things are working fine till now.
Now I play a wav file on the channel (using command: curl -s -X POST 'http://asterisk-uname:asterisk-pwd@:8020/ari/channels/10-1-242-121-1726581143.32/play?media=sound:/Recording/audio/Hindi_comboâ). The announcement is audible at user.
After about 4 seconds of this announcement playing, we get the event âRecordingFinishedâ. Everything else works fine from here on, but recording is stopped at this point.
Observations:
Two channels are created for recording rec-channel-id;1 and rec-channel-id;2
Received warning on asterisk console logs (after about 4 seconds of playing announcement): WARNING[2947367][C-00000044]: app.c:1941__ast_play_and_record: No audio available on Recorder/rec-channel-id;1??
RecordingFinished is received for both the Recording channels created - rec-channel-id;1 and rec-channel-id;2
Versions and values Asterisk version: Asterisk 18.11.1 built by root @ my-hostname on a x86_64 running Linux on 2024-02-26 06:00:44 UTC Media file details:
$ soxi Hindi_combo.wav
Input File : âHindi_combo.wavâ
Channels : 1
Sample Rate : 8000
Precision : 16-bit
Duration : 00:00:14.62 = 116928 samples ~ 1096.2 CDDA sectors
File Size : 234k
Bit Rate : 128k
Sample Encoding: 16-bit Signed Integer PCM
The recorder in a bridge currently expects a consistent stream of audio. When you play audio to a channel in a bridge, it temporarily is suspended from the bridge and its audio no longer goes to the bridge resulting in the recorder leaving. You can file an issue[1] but there is no time frame or guarantee of resolution. A workaround would be to ensure there is always a source of audio in a bridge, such as temporarily adding another channel while doing playback.
Thanks for the answer @jcolp. As a work-around, instead of playing on channel, we are now playing on bridge, and that seems to work fine as per our requirement.
Thanks for the answer @jcolp. As a work-around, instead of playing on channel, we are now playing on bridge, and that seems to work fine as per our requirement.