ARI channel recording and playback


I am using Asterisk 15.5, with PJSIP, sipML5, Stasis and ARI.

I am trying to answer a channel, start recording on that channel and do a playback. Below is my ARI code snippet:

channel_name = channel.json.get(‘name’)
channel.record(name=channel_name, format=‘wav’, ifExists=‘overwrite’)
playback_id = str(uuid.uuid4())
playback = channel.playWithId(playbackId=playback_id,
print(“play back started”)

But When I see the Asterisk console logs, Playback is starting till the recording is completed, I tried flipped the recording and playback, even in this case playback is blocking the recording.

I am not able to hear playback, and not getting that audio in recorded file. Here are some of the screenshots of log:

  1. Screen shot of ARI print statments. All the print statements are executed when the call connected.


  1. Screenshot of Asterisk logs before hungup:

  1. Screen shot of Asterisk logs after hungup:

Record is the equivalent of Record in the dialplan. It is not the same as MixMonitor. ARI instead provides the primitives required to implement MixMonitor by using a Snoop channel to create a second audio feed of the channel, and then calling Record on the Snoop channel that was created.