Carrier sends rtp from different ip address than sip server and no audio calls

We are working on integrating with a new carrier. This carrier gave us the IP address (190.119.245.139) as their SIP server, however outbound calls do not have audio because the carrier configuration sends the RTP media through a different IP address than the SIP server (172.31.229.113).
We have a configuration in the PJSIP trunk that shows ok.
What change do we have to make in the trunk so that it accepts RTP from a server different from the SIP Server?

I am attaching screen shoots of my trunk configuration and wireshar trace





Assuming that it accepts media sent to the address and port from which it sends, no changes to FreePBX are required. If that isn’t true, turn off symmetric media, but that would be very rare. It is much more likely that the router it blocking this. Make sure that the Asterisk RTP port range is unconditionally forwarded to the Asterisk machine.

Thanks for you replay, I just made chages that you recommended even I stopped the firewall

  1. turn off symmetric media at trunk PJSIP
  2. I increased port range from 10000 to 90000
    Same behaivor
    trace say that is connected, but no audio and disconnected after 8 seconds
    I found an error message on my RTP trace log

[2024-07-31 10:02:24] ERROR[4777]: res_pjsip_header_funcs.c:723 remove_header: No headers had been previously added to this session.


here is the entire trace log

RTP Packet Debugging Enabled
agi://127.0.0.1/sangomacrm.agi: LINKEDID: 1722420144.1635
agi://127.0.0.1/sangomacrm.agi: SOURCE: 85260
agi://127.0.0.1/sangomacrm.agi: DESTINATION: 3150730
agi://127.0.0.1/sangomacrm.agi: DIRECTION: OUTBOUND
agi://127.0.0.1/sangomacrm.agi: EXTTOCALL:
agi://127.0.0.1/sangomacrm.agi: START
agi://127.0.0.1/sangomacrm.agi: SCRIPT: php /var/www/html/admin/modules/sangomacrm/importOne.php ‘eyJ1dWlkIjoiMTcyMjQyMDE0NC4xNjM1Iiwic291cmNlIjoiODUyNjAiLCJkZXN0aW5hdGlvbiI6IjMxNTA3MzAiLCJkaXJlY3Rpb24iOiJPVVRCT1VORCIsInR5cGUiOiJTVEFSVCIsInp1bHVfcmF3X3R5cGUiOiIiLCJ6dWx1X3R5cGUiOiIiLCJ6dWx1X3VybCI6IiIsImV4dHRvY2FsbCI6IiIsImNudW0iOiIxMjM0NTYiLCJjbmFtIjoiIiwiY2FsbHBvcCI6ZmFsc2UsInZvaWNlbWFpbCI6IiIsImZyb21fZGlkIjoiIn0=’ > /dev/null 2>&1 &
[2024-07-31 10:02:24] ERROR[4777]: res_pjsip_header_funcs.c:723 remove_header: No headers had been previously added to this session.
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005705, ts 038800, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013669, ts 038800, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005706, ts 038960, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013670, ts 038960, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005707, ts 039120, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013671, ts 039120, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005708, ts 039280, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013672, ts 039280, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005709, ts 039440, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013673, ts 039440, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005710, ts 039600, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013674, ts 039600, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005711, ts 039760, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013675, ts 039760, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005712, ts 039920, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013676, ts 039920, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005713, ts 040080, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013677, ts 040080, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005714, ts 040240, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013678, ts 040240, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005715, ts 040400, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013679, ts 040400, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005716, ts 040560, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013680, ts 040560, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005717, ts 040720, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013681, ts 040720, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005718, ts 040880, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013682, ts 040880, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005719, ts 041040, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013683, ts 041040, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005720, ts 041200, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013684, ts 041200, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005721, ts 041360, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013685, ts 041360, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005722, ts 041520, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013686, ts 041520, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005723, ts 041680, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013687, ts 041680, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005724, ts 041840, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013688, ts 041840, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005725, ts 042000, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013689, ts 042000, len 000160)
[2024-07-31 10:02:25] WARNING[4777]: res_pjsip_outbound_registration.c:1383 handle_registration_response: 403 Forbidden fatal response received from ‘sip:190.119.245.139:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’ seconds
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005726, ts 042160, len 000160)
Sent RTP packet to 172.31.229.113:14778 (type 08, seq 013690, ts 042160, len 000160)
Got RTP packet from 90.188.226.100:40030 (type 08, seq 005727, ts 042320, len 000160)

agi://127.0.0.1/sangomacrm.agi: LINKEDID: 1722420144.1635
agi://127.0.0.1/sangomacrm.agi: SOURCE: 85260
agi://127.0.0.1/sangomacrm.agi: DESTINATION: 3150730
agi://127.0.0.1/sangomacrm.agi: DIRECTION: OUTBOUND
agi://127.0.0.1/sangomacrm.agi: EXTTOCALL:
agi://127.0.0.1/sangomacrm.agi: START
agi://127.0.0.1/sangomacrm.agi: SCRIPT: php /var/www/html/admin/modules/sangomacrm/importOne.php ‘eyJ1dWlkIjoiMTcyMjQyMDE0NC4xNjM1Iiwic291cmNlIjoiODUyNjAiLCJkZXN0aW5hdGlvbiI6IjMxNTA3MzAiLCJkaXJlY3Rpb24iOiJPVVRCT1VORCIsInR5cGUiOiJFTkQiLCJ6dWx1X3Jhd190eXBlIjoiIiwienVsdV90eXBlIjoiIiwienVsdV91cmwiOiIiLCJleHR0b2NhbGwiOiIiLCJjbnVtIjoiMTIzNDU2IiwiY25hbSI6IiIsImNhbGxwb3AiOmZhbHNlLCJ2b2ljZW1haWwiOiIiLCJmcm9tX2RpZCI6IiJ9’ > /dev/null 2>&1 &
31575797*CLI>

I read in some other similar post that the SIP server is not rediecting the RTP ip address in the header, but I am not sure if is this my scenario.
I saw the message that I am sharing in the log

[2024-07-31 10:02:24] ERROR[4777]: res_pjsip_header_funcs.c:723 remove_header: No headers had been previously added to this session.

Thanks in advamce
SL

The SIP trace in post 2 shows ACK being sent to 172.31.229.113. This seems wrong; possibly a SIP ALG has incorrectly modified the traffic. Also note that 172.16-31.x.x is a private IP range not routable on the public internet. Unless your new carrier is also your ISP, packets sent to 172.31.229.113 will not reach them. If they have provided you with physical connectivity, but they are not your only ISP, confirm that communication with them is via the link they provided.

If you still have trouble, at the Asterisk command prompt, type
pjsip set logger on
make a failing call, paste the Asterisk log for the call at pastebin.com and post the link here.

Also, what router/firewall are you using? Does it have a public IP address on its LAN interface?

Your local network setting doesn’t make sense! I think you need to describe your network configuration.

Thank you very much for the answers.
It is possible that I should have provided more network configuration first and provide more details about it.

The server IP address is → 104.200.73.227 which is a public IP address (cloud server) U.S.
Our phones are in Asia.

The SIP server IP address is → 190.119.245.139:5160, Peru
Media Server → 172.31.229.113

The central has two internet links and a VPN with a SIP provider, they use that mask to communicate with said provider, that IP is in the SIPNAT as the central’s external address.

The audio from the central is not heard because it is waiting for RTP from another IP, because we keep waiting and sending a response from another IP and that is why it is cut off after 8 seconds once the call is established.

Here is the PJSIP SET LOGGER ON

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