RTP flow stops during playback in ari channel

Hi, I’m using RTP socket for externalMedia in the ARI channel nodejs. Whenever i tried to playback in the channel RTP flow gets stopped. I need RTP flow should continues in playback

kindly share/add more detail about this error. add error logs for knowing more detail about your problem.

Best regard
Danish Hafeez | QA Assistant

I’m not getting any specific errors. Whenever I start playback on channel, it’s RTP flow gets stopped. Without playback RTP flow works fine. Please find my simple code below,

async function stasisStart(evt, channel) {
await channel.answer();

var bridge = channel._client.Bridge()

try {
    await bridge.create({ type: "mixing" });
} catch (e) {

bridge.addChannel({ channel: channel.id });

var externalChannel = channel._client.Channel();
externalChannel.on('StasisStart', (event, chan) => {
    bridge.addChannel({ channel: chan.id });

channel.on('StasisEnd', (event, chan) => {

try {
    let resp = await externalChannel.externalMedia({
    	app: "externalMedia",
        external_host: '',
        format: 'ulaw',
        direction: 'both'
} catch (error) {

const playback = await channel.play({ media: `sound:${channelId}_in`, offsetms: 2000, "m": "beep", "mix": true });
if (playback) {
    playback.once('PlaybackFinished', (event, playback1) => {


rtpengineClient.on('message', (msg) => {
    try {
        const pcmData = msg.slice(12);
        socket.emit('audio', { 'data': pcmData });
    } catch (e) {


function stasisEnd(evt) {
console.log(StasisEnd: Channel ${evt.channel.name} left Stasis);

ari.connect(‘’, ‘username’, ‘password’, async (err, client) => {
if (err) {
console.error(‘Error connecting to ARI:’, err);

client.on('StasisStart', stasisStart);
client.on('StasisEnd', stasisEnd);

await client.start('externalMedia');
console.log('ARI application started');


const rtpengineClient = new rtp.RtpUdpServerSocket(;

I have a sense of dejavu as I think I post this every week at this point on this forum…

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.