Rtp.conf do not respect ports

hi I have set Rtp.cfg to work with port range from 10000 to 20000 udp. However some Sip Trunks work and transmit rtp packages from port 32000 ± and is suppose it should work between 10000 to 20000 udp, how I can force the sip trunk to work with set ports in rtp.cfg ??? Thanks so much for any help

Did you do a “amportal restart” to restart your Asterisk PBX? Or better yet, from the Asterisk CLI>sip restart

yes I have did amportal restart, sip reload even reboot

but sip trunk is working inf port range 38k

you can see this is happening in the rtp debug know is in port 44k

Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018556, ts 1633537336, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000171, ts 027360, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053296, ts 1633537502, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018557, ts 1633537496, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000172, ts 027520, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053297, ts 1633537662, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018558, ts 1633537656, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000173, ts 027680, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053298, ts 1633537822, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018559, ts 1633537816, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000174, ts 027840, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053299, ts 1633537982, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018560, ts 1633537976, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000175, ts 028000, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053300, ts 1633538142, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018561, ts 1633538136, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000176, ts 028160, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053301, ts 1633538302, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018562, ts 1633538296, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000177, ts 028320, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053302, ts 1633538462, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018563, ts 1633538456, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053303, ts 1633538622, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018564, ts 1633538616, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000178, ts 028480, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000179, ts 028640, len 000020)
Got RTP packet from 192.168.2.108:11002 (type 18, seq 053304, ts 1633538782, len 000020)
Sent RTP packet to 200.76.112.1:44428 (type 18, seq 018565, ts 1633538776, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000180, ts 028800, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000181, ts 028960, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000182, ts 029120, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000183, ts 029280, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000184, ts 029440, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000185, ts 029600, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000186, ts 029760, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000187, ts 029920, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000188, ts 030080, len 000020)
Got RTP packet from 200.76.112.1:44428 (type 18, seq 000189, ts 030240, len

This what it should look like:

; RTP Configuration
;
[general]
;
; RTP start and RTP end configure start and end addresses
;
rtpstart=10000
rtpend=20000

here my set

;
; RTP Configuration
;
[general]
;
; RTP start and RTP end configure start and end addresses
;
rtpstart=10000
rtpend=21100

the filename is rtp.conf in /etc/asterisk not rtp.cfg

yes it was a typo but the rtp is conf

rtp.conf inside etc/asterisk

and is set as bellow. and the sip trunk is not working rtp between that range
how can I force the sip trunk to work behind this rtp range ??
;
; RTP Configuration
;
[general]
;
; RTP start and RTP end configure start and end addresses
;
rtpstart=10000
rtpend=21100

my provider did a trace and told me that the port 45k average is comming from my router

first router that supply internet

but i dont know how to make to work with specific range rtp port

my network is

2wire (internet and public ip, doing port forwarding to 2 router)--------------dd-wrt private ip doing port forwarding to asterisk box-------------------asterisk

rtp.conf is set 10000 to 20000
port forwarding in both routers 5004 to 5082 and 10000 to 20000 UDP

have no idea why first router is sending rtp packages inside range 35k to 45k

It could be that dd-wrt is doing NAT and PAT - PAT is port address translation which is the exact opposite of what you want. It will translate ports 10000-20000 to a different port range. Can you disable port translation? How about making a virtual server? When anything comes into the WAN IP of your router with SIP and RTP, forward it to your PiaF server.

HI. the first router is a 2wire modem. it has no option for virtual server, and i think it is no way to disable PAT.

I think the problem as you tell is that frist router 2wire is doing PAT an converting the incoming ports 10000-20000 to ports 35k up

do you think is there a option in linux that act as virtual server but then route the rtp trafic to freepbx ?
the virtual server if exist for linux should be installed in the same box as freepbx

I was wondering if other option could be make the rtp.conf from 10000 to 45000 instead of 20000 ?

or what do you suggest if there is other options to fix this ?

I modify RTP.conf to work with from 10000 udp to 45000 udp.
since the sip trunk was working in the range of 35k to 45k udp
when I did this. and execute Sip reload and amportal etc

then the sip trunk is working now in the range of 10400 as it should be I think this is very weird how could you explain that ?