ARI channel recording and playback


#1

Hi,

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.answer()
print(“answered”)
channel.record(name=channel_name, format=‘wav’, ifExists=‘overwrite’)
print(“recording”)
playback_id = str(uuid.uuid4())
playback = channel.playWithId(playbackId=playback_id,
media=‘sound:hello-world’)
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.

Screenshot%20(154)

  1. Screenshot of Asterisk logs before hungup:

  1. Screen shot of Asterisk logs after hungup:


#2

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.