[a=candidate] is advertising local IPs, is it a cause of inbound call drops after ~30 seconds

Following is a packet from my PJSIP log. Here we can see that
a=candidate is advertising local IPs and I suspect because of this Asterisk is not getting ACK packet and hence call drops after ~30 seconds. Outbound calls are working fine.
Asterisk is on AWS. No NAT.

<— Transmitting SIP response (2413 bytes) to TLS:69.171.251.116:57112 —>
SIP/2.0 200 OK
Via: SIP/2.0/TLS 157.240.229.209:5061;rport=57112;received=69.171.251.116;branch=z9hG4bKPj90c4463f4ed82bbaeb58bf06d03b87ca;alias
Via: SIP/2.0/TLS [2803:6080:e870:eb3:caa7:55b:14b7:a00]:5061;branch=z9hG4bKPj90c4463f4ed82bbaeb58bf06d03b87ca
Via: SIP/2.0/TLS [2803:6080:e870:eb3:f4d2:6d54:140b:a00]:57089;rport=57089;received=2803:6080:e870:eb3:f4d2:6d54:140b:a00;branch=z9hG4bKPjGPIdpEZqWVPdyo1OJ2f8OhZV4zOxGgCk;alias
Record-Route: sip:69.171.251.116:57112;transport=TLS;lr
Record-Route: sip:onevc-sip-proxy.fbinfra.net:8191;transport=tls;lr
Call-ID: outgoing:wacid.HBgMOTE5Nzk5NzUwNzQzFQIAEhggMTJCRTRFQjBEQUMwNzAxMzhBNjE4RURFQzUxMzQ4MzAcGAw5MTExNDU4NzQxNDEVAgAVHgA
From: “91979975” sip:+91979975@wa.meta.vc;tag=df93bb89-b765-4a8f-82a2-0e9f743d84bd
To: sip:+91114587@stag2.wchatter.com;tag=3693f99b-2d13-4170-b1af-b6ff157fdc93
CSeq: 26192 INVITE
Server: Asterisk PBX 22.5.2
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, MESSAGE, REFER
P-Asserted-Identity: sip:extension@stag2.wchatter.com
Remote-Party-ID: sip:extension@stag2.wchatter.com;party=called;privacy=off;screen=no
Contact: sip:216.48.187.21:5061;transport=TLS
Supported: replaces, norefersub
Content-Type: application/sdp
Content-Length: 1102

v=0
o=- 1757991521277 4 IN IP4 216.48.187.21
s=Asterisk
c=IN IP4 216.48.187.21
t=0 0
a=msid-semantic:WMS *
a=group:BUNDLE audio
m=audio 13650 UDP/TLS/RTP/SAVPF 111 126
a=connection:new
a=setup:active
a=fingerprint:SHA-256 20:B5:85:E4:94:AA:FD:07:8D:01:35:81:9E:33:8E:47:74:E1:9C:49:67:3C:53:27:C5:A7:3F:5C:CD:2D:63:DB
a=ice-ufrag:391f770374c72ae2438a37b31dbbbd87
a=ice-pwd:6e0ab121123faa427b7ed0794ace99e3
a=candidate:Hd830bb15 1 UDP 2130706431 216.48.187.21 13650 typ host
a=candidate:Hac1077a4 1 UDP 2130706431 172.16.119.164 13650 typ host
a=candidate:Hac110001 1 UDP 2130706431 172.17.0.1 13650 typ host
a=candidate:Hac120001 1 UDP 2130706431 172.18.0.1 13650 typ host
a=rtpmap:111 opus/48000/2
a=fmtp:111 maxplaybackrate=16000;sprop-maxcapturerate=16000;maxaveragebitrate=20000;useinbandfec=1
a=ptime:20
a=maxptime:20
a=sendrecv
a=rtcp-mux
a=ssrc:782844785 cname:9e893646-eb58-47cf-a4e6-45aa21ca2f52
a=msid:6103c85e-1767-4535-b4f4-181ae8cef930 3e43c686-44e5-4230-8238-4dcfeacad1d8
a=rtcp-fb:* transport-cc
a=mid:audio
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16

Candidate lines are not used for SIP routing.

You should provide an actual full trace of the complete SIP interaction including when it is terminated.

pjsip-logs.txt (46.8 KB)
Here are my logs

Is TCP port 5061 forwarded to Asterisk, and has a proper TLS certificate?

Meta may be trying to establish a connection back.

My pjsip.conf

[global]
external_signaling_address=stag2.wchatter.com

[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/asterisk/keys/fullchain.crt
priv_key_file=/etc/asterisk/keys/privkey.key
method=tlsv1_2
external_signaling_address=stag2.wchatter.com
external_media_address=stag2.wchatter.com

For other types like endpoint, auth, aor etc. I am using realtime.
Outbound calls to Meta are working fine no call drop after about ~30 seconds.

That didn’t answer my question fully.

Aside from my previous comment about the port being forwarded, I don’t see any other reason why it would fail from an Asterisk perspective. It’s up to the remote side to send the ACK so either it is not getting sent which would be against spec, it’s getting lost in their network, or something in between is preventing it (such as them not being able to get a TLS connection back to you if they don’t do connection reuse).

I found the fix for 30 seconds automatic call drop when integrating Asterisk with Meta.
As per How to Connect WhatsApp Business Cloud Voice Calling to Asterisk with PJSIP (Vanilla Asterisk) – Official WhatsApp Business Cloud API blog by ORENCLOUD

; --- THE 30-SECOND CALL DROP FIX (For Public IP Servers) ---
rewrite_contact=no                    ; ❗️Crucial: Prevents Asterisk from rewriting headers
rtp_symmetric=no                      ; Works in tandem with rewrite_contact=no

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