# ARI channel recording and playback

**URL:** <https://community.asterisk.org/t/ari-channel-recording-and-playback/77900>\
**Category:** Asterisk APIs\
**Created:** [January 4, 2019, 5:55am UTC](https://community.asterisk.org/t/ari-channel-recording-and-playback/77900 "2019-01-04T05:55:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mani3274](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mani3274](https://community.asterisk.org/u/Mani3274)\
**Post date:** [January 4, 2019, 5:55am UTC](https://community.asterisk.org/t/ari-channel-recording-and-playback/77900/1 "2019-01-04T05:55:06Z")

</div>

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)](https://global.discourse-cdn.com/asterisk/original/2X/c/ce53384ddfd0c8b7391617d948efe2ec9e27ac1e.png)

1. Screenshot of Asterisk logs before hungup:

 ![Screenshot%20(153)](https://global.discourse-cdn.com/asterisk/original/2X/6/6f19104b501cbe9b1a4dd8d790f8306fc50e0e2a.png)

1. Screen shot of Asterisk logs after hungup:

 ![Screenshot%20(155)](https://global.discourse-cdn.com/asterisk/original/2X/d/d579b1217c75e7fc79a7c3f24d2e226491604d7f.png)

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 4, 2019, 10:55am UTC](https://community.asterisk.org/t/ari-channel-recording-and-playback/77900/2 "2019-01-04T10:55:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [September 5, 2023, 8:45am UTC](https://community.asterisk.org/t/ari-channel-recording-and-playback/77900/3 "2023-09-05T08:45:04Z")

</div>

A post was split to a new topic: [Error when doing ARI Record](https://community.asterisk.org/t/error-when-doing-ari-record/98518)

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [September 5, 2023, 8:45am UTC](https://community.asterisk.org/t/ari-channel-recording-and-playback/77900/4 "2023-09-05T08:45:15Z")

</div>


