RTP port negotiation

I have internal (on the same network as the PBX) and external (via NAT) phones. A recent change in routers required some changes to get my external phones working. I got it running but am prompted to try to understand how RTP ports work/are agreed on…

Previous Netgear router worked well, no problem with external phones:

  • Yealink phones have default RTP range 11780-11800
  • Router forwarding ports 10000-20000
  • FreePBX RTP ports default 10000-20000

Switching to a Draytek:

  • No change to phone ports
  • Router set up in the same way as before, 10000-20000
  • No audio on FreePBX - but fixed when set the RTP ports to match the phone ports, 11780-11800

This prompts various questions:

  • Which end decides which RTP ports to use? This suggests that FreePBX was using ports from the larger range, which were not accepted by the phone
  • In which case, how/why did it work with the previous router?
  • How many RTP ports are needed per call - by setting FreePBX to this smaller range, am I limiting how many calls it will handle?

Any help in understanding much appreciated!

The RTP range inside FreePBX is for Asterisk and the range it will use. The range on the phone is for the phone itself to use.

So in a call Asterisk will say send me RTP to port 10200 for all my media. The phone will say send me media on port 11780. That is all normal as each device is telling the other device where to send media to itself. They wont be on the same port or even in the same range most the time.