External media not sending any rtp data

extensions.conf
exten => 7001,1,NoOp(entering ari)
exten => 7001,2,Stasis(myapp)
exten => 7001,3,Hangup()

exten => 7002,1,Answer()
exten => 7002,2,Dial(PJSIP/7002,60)
exten => 7002,3,Playback(vm-nobodyavail)
exten => 7002,4,VoiceMail(7001@main)
exten => 7002,5,Hangup()
external media not sending rtp chunks to server
debug log
– Executing [7001@internal:1] NoOp(“PJSIP/7002-00000000”, “entering ari”) in new stack
– Executing [7001@internal:2] Stasis(“PJSIP/7002-00000000”, “myapp”) in new stack
– Called 0.0.0.0:5004/c(ulaw)
– UnicastRTP/0.0.0.0:5004-0x7f2fc8005370 answered
– Channel PJSIP/7002-00000000 joined ‘simple_bridge’ stasis-bridge
– Channel UnicastRTP/0.0.0.0:5004-0x7f2fc8005370 joined ‘simple_bridge’ stasis-bridge

ari.connect(${ARI_HOST}/ari, ARI_USER, ARI_PASSWORD)
.then((arinew) => {
console.log(“:white_check_mark: Connected to Asterisk ARI”);
// console.log(arinew.externalMedia);
arinew.once(‘StasisStart’, (event, channel) =>{
console.log(“Getting user”);
// console.log(event);
// console.log(channel.externalMedia);
channel.answer();
// channel.play(“hellow-wrold”);
arinew.channels.externalMedia({
app: ‘myapp’,
external_host: ‘0.0.0.0:5004’,
format: ‘ulaw’
}).then((response)=>{
// console.log(response);
// const bridghe = arinew.channels.create({type: ‘mixing’});
// console.log(bridghe);
// arinew.bridges.list().then((x)=> console.log(x)).error((errr)=> console.log(errr));
arinew.bridges.create({type: ‘mixing’})
.then((bridge)=> {
console.log(bridge);
bridge.addChannel({channel: [channel.id, response.id]})
.then((x)=>{console.log("successfully added ");
console.log(x);
})
.error((y)=> console.log(“error creting link”));
// bridge.startMoh();
console.log(bridge.startExternalMedia);
});

        //bridge = arinew.bridges.create({type: 'mixing'});
        //console.log(bridge);
        //bridge.addChannel({channel: [channel.id, response.id]})
        //.then((response1)=> console.log("add channel"))
        //.error(()=> console.log("error in bridge creating"));

        channel.on('ChannelHangupRequest', ()=>{console.log("cealn");})
    }
    ).error((err)=> console.log(err));
});


arinew.once('StasisEnd', (event, chennel)=>{
    console.log("end");
});
// Listen for new calls

// Start ARI application
arinew.start('myapp');

})
.catch((err) => {
console.error(“:x: Error connecting to ARI:”, err);
});

Normally this would be 127.0.0.1 for localhost.

Have you actually written the logic in your ARI application to listen on that port, receive the RTP traffic, and get/use the data?

when I put 127.0.0.1:5211 asterisk not sending any data, but channel and bridge created properly,

  • Executing [7001@internal:2] Stasis(“PJSIP/7002-00000002”, “myapp”) in new stack
    – Called 127.0.0.1:5211/c(ulaw)
    – UnicastRTP/127.0.0.1:5211-0x7fb7500090f0 answered
    – Channel PJSIP/7002-00000002 joined ‘simple_bridge’ stasis-bridge
    – Channel UnicastRTP/127.0.0.1:5211-0x7fb7500090f0 joined ‘simple_bridge’ stasis-bridge
    ,yes I put receiver on server 127.0.0.1 with port 5211 but not receving any rtp data, please suggest how I can use ari to send and receive rtp data

Use “rtp set debug on” or a packet capture on loopback to confirm Asterisk isn’t sending media.

I did, not getting any rtp data, but when I use 0.0.0.0 that time I am getting Sent RTP packet to 0.0.0.0:5211 (type 00, seq 050528, ts 7486147, len 000160), but at listener side I am not getting anything

i am using asterisk 22, I am using microsip to call to ari

0.0.0.0 is not an assignable IP address.

I have created an ari workflow with rtp built in, maybe you can take a look at it and how it works, it has a lot of comments in the code:

  • You definitely need to configure an IP where you will send the asterisk RTP stream.
  • Check the SIP debug messages, maybe an SDP acknowledgment is not received on your extension. Without that, the extensions do not send rtp audio.
  • You can compare logs calling between extensions.

I use that code, with moh I am getting rtp stream, but caller audio, i am not getting rtp stream. Here is my pjsip.conf
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5060

[7001]
type = endpoint
context = internal
disallow = all
allow = ulaw
auth = 7001
aors = 7001
transport = transport-udp
direct_media = no
media_encryption = none
direct_media = no
ice_support = no
media_use_received_transport = yes
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes

[7001]
type = auth
auth_type = userpass
username = 7001
password = 7001

[7001]
type = aor
max_contacts = 1

[7002]
type = endpoint
context = internal
disallow = all
allow = ulaw
auth = 7002
aors = 7002
transport = transport-udp
direct_media = no

[7002]
type = auth
auth_type = userpass
username = 7002
password = 7002

[7002]
type = aor
max_contacts = 1

----end---------
any configuration do I need to add or remove?

right now I am using 127.0.0.1:12000 as external host

You need to actually show the output of things, such as “rtp set debug on”, and the Asterisk console output so we can confirm and see.

Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006035, ts 082560, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006036, ts 082720, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006037, ts 082880, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006038, ts 083040, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006039, ts 083200, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006040, ts 083360, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006041, ts 083520, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006042, ts 083680, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006043, ts 083840, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006044, ts 084000, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006045, ts 084160, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006046, ts 084320, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006047, ts 084480, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006048, ts 084640, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006049, ts 084800, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006050, ts 084960, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006051, ts 085120, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006052, ts 085280, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006053, ts 085440, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006054, ts 085600, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006055, ts 085760, len 000160)
Sent RTP packet to 127.0.0.1:12000 (type 00, seq 006056, ts 085920, len 000160)

above is that log, any others way to create sip phone using asterisk ari

According to that Asterisk is sending RTP to that IP address and port - so is your current issue that it is not in your ARI application?

And what does “create sip phone using asterisk ari” mean?

this log is generated when I am using start moh, I am using asterisk ari app with externalmedia

does snoopchannel can send audio to caller ?

If it’s provided audio from something…

At this point I’m confused over this thread.

I can hear as I am using microsip as another client . And i originate call from my ari app , moh tune I can hear in microsip , but when I stop moh , I am not getting actual voice audio rtp packet which should come from caller

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