RTP Debug: Wrong advertised port

Hello Everyone,

I’m having some issues with RTP and need some help debugging. I know the problem is the RTP port advertised by the call center. We both tried adjusting the configuration on their side, but since we weren’t getting anywhere, I tried fixing it on my end using rtp_symmetric. This had worked before, but after removing the ports: 10000-14000:10000-14000 mapping from my Docker Compose file—because it was taking too long to start—RTP stopped working for unregistered endpoints that don’t advertise the correct IP:Port, my network on docker is bridge type. Registered endpoints and non registered that advertised correct IP:Port still work fine.

While testing, I discovered that if I don’t use rtp_symmetric and I send an incorrect 200 OK back to the call center, it somehow starts sending RTP from the correct advertised port. However, the call eventually times out because it doesn’t know where to send the ACK.

Is there any solution I can apply on the Asterisk side to fix this issue?

rtp.conf

[general]
rtpstart = 10000
rtpend = 14000

pjsip.conf

[transport-udp-nat]
type=transport
protocol=udp
bind=0.0.0.0
local_net=172.18.0.0/16
external_media_address={VM Public IP}
external_signaling_address={VM Public IP}

[callcenter]
type=endpoint
transport=transport-udp-nat
context=public
disallow=all
allow=g722
allow=ulaw
allow=alaw
direct_media=no
rtp_symmetric=yes
aors=callcenter
set_var=PROJECT_ID=Project
set_var=ORIGIN=phone-sip
; Configures the endpoint for incoming/outgoing calls and media handling

[callcenter]
type=identify
endpoint=callcenter
match={Endpoint IP}

[callcenter]
type=aor
contact= sip:{IP}:5060

SIP Logs:

<--- Received SIP request (1263 bytes) from UDP:{Endpoint IP}:35252 --->
INVITE sip:100@{VM Public IP} SIP/2.0
Via: SIP/2.0/UDP {Endpoint IP};rport;branch=z9hG4bKFmHSe8NpKmv4g
Max-Forwards: 69
From: "601" <sip:FreeSWITCH@{VM Public IP}>;tag=3K6HD7Z710v9N
To: <sip:100@{VM Public IP}>
Call-ID: a7a828eb-4bc7-123f-14bc-0050569094df
CSeq: 107877032 INVITE
Contact: <sip:gw+07143571-a044-4cb3-9650-d52267267b09@{Endpoint IP}:5060;transport=udp;gw=07143571-a044-4cb3-9650-d52267267b09>
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 299
X-FS-Support: update_display,send_info
Remote-Party-ID: "601" <sip:601@{VM Public IP}>;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1764841639 1764841640 IN IP4 {Endpoint IP}
s=FreeSWITCH
c=IN IP4 {Endpoint IP}
t=0 0
m=audio 20010 RTP/AVP 9 0 8 101
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=silenceSupp:off - - - -
a=ptime:20

<--- Transmitting SIP response (335 bytes) to UDP:{Endpoint IP}:35252 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP {Endpoint IP};rport=35252;received={Endpoint IP};branch=z9hG4bKFmHSe8NpKmv4g
Call-ID: a7a828eb-4bc7-123f-14bc-0050569094df
From: "601" <sip:FreeSWITCH@{VM Public IP}>;tag=3K6HD7Z710v9N
To: <sip:100@{VM Public IP}>
CSeq: 107877032 INVITE
Server: Asterisk PBX 20.15.2
Content-Length:  0


<--- Transmitting SIP response (899 bytes) to UDP:{Endpoint IP}:35252 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP {Endpoint IP};rport=35252;received={Endpoint IP};branch=z9hG4bKFmHSe8NpKmv4g
Call-ID: a7a828eb-4bc7-123f-14bc-0050569094df
From: "601" <sip:FreeSWITCH@{VM Public IP}>;tag=3K6HD7Z710v9N
To: <sip:100@{VM Public IP}>;tag=9dc4eb96-c4a1-46db-9b73-086cac18be25
CSeq: 107877032 INVITE
Server: Asterisk PBX 20.15.2
Contact: <sip:{VM Public IP}:5060>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER, INFO
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   291

v=0
o=- 1764841639 1764841642 IN IP4 {VM Public IP}
s=Asterisk
c=IN IP4 {VM Public IP}
t=0 0
m=audio 10022 RTP/AVP 9 0 8 101
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

RTP Debug:

Sent RTP packet to      {Endpoint IP}:20010 (type 09, seq 023207, ts 015440, len 000080)
Sent RTP packet to      {Endpoint IP}:20010  (type 09, seq 023208, ts 015520, len 000080)
Sent RTP packet to      {Endpoint IP}:20010 (type 09, seq 023209, ts 015600, len 000080)
Sent RTP packet to      {Endpoint IP}:20010 (type 09, seq 023210, ts 015680, len 000080)
Sent RTP packet to      {Endpoint IP}:20010 (type 09, seq 023211, ts 015760, len 000080)

Thank you.

In order for rtp_symmetric to work media has to reach Asterisk. If you don’t forward the ports and Asterisk doesn’t get the media, then it won’t work.

From an Asterisk perspective I can’t think of anything else for this.

I figured as much.
Thank you.

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