Not getting audio and video while calling

Not getting audio while calling from two clients using asterisk 18.20

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060

[transport-ws]
type=transport
protocol=ws
bind=0.0.0.0:8088

[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0:8089

[7000]
type=endpoint
context=from-external
transport=transport-udp
disallow=all
allow=ulaw
auth=7000
aors=7000
direct_media=no

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

[7000]
type=aor
max_contacts=1

this is my pjsip.conf

What are the endpoints? Are they behind NAT? Is Asterisk behind NAT? What does a SIP trace show (pjsip set logger on)? Is Asterisk receiving the RTP?

→ I have configured Asterisk For WebRTC.

→ This is the log after “pjsip set logger on”.

<— Received SIP request (1281 bytes) from UDP:ip:43343 —>
PUBLISH sip:8000@ip:5060 SIP/2.0
Via: SIP/2.0/UDP ip:43343;branch=z9hG4bK.k8Zil07Gs;rport
From: “g” sip:8000@ip;tag=nge4OPo2G
To: “g” sip:8000@ip
CSeq: 21 PUBLISH
Call-ID: pgS~5ShqkD
Max-Forwards: 70
Supported: replaces, outbound, gruu, path, record-aware
Event: presence
Content-Type: application/pidf+xml
Content-Length: 507
Expires: 3600
User-Agent: LinphoneAndroid/5.1.4 (Pixel 4a) LinphoneSDK/5.2.110 (tags/5.2.110^0)
Authorization: Digest realm=“asterisk”, nonce=“1700480787/2d43da07a74e2b6128eeea3a45e6151e”, algorithm=MD5, opaque=“4f8fc0c442609a60”, username=“8000”, uri=“sip:8000@ip:5060”, response=“2f385ebfd54074e21a0d5ba0deb8a346”, cnonce=“fk22vvUSx8y7q7U7”, nc=00000001, qop=auth

<?xml version="1.0" encoding="UTF-8"?> open sip:8000@ip:5060 2023-11-20T11:46:26Z

Are the clients:

  • on the same network as the Asterisk server
  • on the same network as each other
  • separated from Asterisk by a router
  • separated from Asterisk by a router doing NAT

Also, what does a SIP packet capture show for SDP from each end?

Antony.

That SIP request has nothing to do with a call.

I have installed asterisk in an AWS Ec2 instance.

http.conf

[general]
enabled=yes
bindaddr=0.0.0.0 ; Replace this with your IP address
bindport=8088 ; Replace this with the port you want to listen on
tlsenable=yes
tlsbindaddr=0.0.0.0:8089 ; Replace this with your IP address
tlscertfile=/etc/asterisk/keys/asterisk.pem

extensions.conf

[from-external]
exten => _XXXX,1,Dial(PJSIP/${EXTEN})
same => n,Hangup()

thsese are the only files i have configured.I am a newbie to asterisk.
Kindly tell me what is happening here.

You’ve picked a complicated scenario with many moving parts to start with. On EC2 you have to configure your EC2 rules to allow RTP traffic (by default ports 10000 to 20000) to forward to Asterisk. You also have to configure Asterisk to know it is behind a 1 to 1 NAT in the rtp.conf file[1]. The PJSIP endpoints are also not configured for WebRTC, so I’m not sure how a call would even start to begin with unless you’re not actually using WebRTC in which case you may need to configure the pjsip.conf to know it is behind NAT as well[2][3]. You will probably also need to configure the PJSIP endpoints to know the remote side is behind NAT[4].

[1] https://github.com/asterisk/asterisk/blob/master/configs/samples/rtp.conf.sample#L133
[2] Configuring res_pjsip to work through NAT - Asterisk Documentation
[3] https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample#L133
[4] https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Configuring-res_pjsip-to-work-through-NAT/#for-remote-phones-behind-nat

Hi, Thank you for the support. After giving external_media_address and external_signaling_addres. I am getting the audio. But for transport=transport-wss audio is not working. What might be the issue

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=IP
external_signaling_address=IP

[transport-ws]
type=transport
protocol=ws
bind=0.0.0.0:8088
external_media_address=IP
external_signaling_address=IP

[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0:8089
external_media_address=IP
external_signaling_address=IP

this is the configuration i changed.

[7000]
type=endpoint
context=from-external
transport=transport-wss
disallow=all
allow=ulaw
allow=g722
auth=7000
aors=7000
direct_media=no
rewrite_contact = yes
rtp_symmetric= yes
force_rport =yes
ice_support=yes
webrtc=yes

rtp.conf was need to be adjusted as previously mentioned so the ICE candidates contain the public IP address.

I should add that if deploying WebRTC, you need a solid understanding and basis of multiple things: networking, Javascript, ICE, STUN, TURN, DTLS-SRTP, SDP, SIP, and more.

May i know what should i give under [ice_host_candidates] in rtp.conf?

Audio is working now but i am not getting video.
[7000]
type=endpoint
context=from-external
transport=transport-udp
disallow=all
allow=ulaw
allow=opus
auth=7000
aors=7000

this is my pjsip configuration

Sent RTP packet to 106.51.77.169:46591 (via ICE) (type 09, seq 030252, ts 032320, len 000170)
Sent RTP packet to 106.51.77.169:46591 (via ICE) (type 09, seq 030252, ts 032320, len 000170)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026371, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026371, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026372, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026372, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026373, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026373, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026374, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026374, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026375, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026375, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026376, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026376, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026377, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026377, ts 2449554832, len 001078)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026378, ts 2449554832, len 001079)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026378, ts 2449554832, len 001079)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026379, ts 2449554832, len 001079)
Got RTP packet from 106.51.77.169:46591 (type 96, seq 026379, ts 2449554832, len 001079)
Got RTP packet from 106.51.77.169:46591 (type 09, seq 015450, ts 2797968229, len 000170)

this is the rtp log

To: sip:7000@454665
Contact: sip:asterisk@7412555
Call-ID: 166cb40f-a637-4740-818e-75b16cef334f
CSeq: 27372 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 18.20.0
Content-Type: application/sdp
Content-Length: 635

v=0
o=- 1503142657 1503142657 IN IP4 43.204.100.248
s=Asterisk
c=IN IP4 43.204.100.248
t=0 0
m=audio 14328 RTP/AVP 9 8 0 107 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:107 opus/48000/2
a=fmtp:107 useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:20
a=sendrecv
m=video 10046 RTP/AVP 100 99 109 103 31 34
a=rtpmap:100 VP8/90000
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1;level-asymmetry-allowed=1;profile-level-id=42E01F
a=rtpmap:109 H265/90000
a=rtpmap:103 h263-1998/90000
a=rtpmap:31 H261/90000
a=rtpmap:34 H263/90000
a=sendrecv

this is the pjsip log

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