yes, most phones generally only have a single RTP port defined. Asterisk, on the other hand, has a range of ports defined in rtp.conf. The default is 10000-20000. Unless you plan on having 5000+ concurrent calls with a high churn rate, you can probably bring that down substantially
If SIP phone is dictating the RTP port number to use, how do the port numbers in rtp.conf come into play? Is it when Asterisk itself acts as a SIP client?
Also, does the SIP phone send two RTP ports or just one? If it is just one, I can narrow down the range further.
Thank you for your help, David. I thik I am still a bit lost.
If I understand you right:
Asterisk tells SIP phone:-- Please talk to me on port 10231 (a port randomly chosen between 10000 and 20000)
SIP phone tells Asterisk:-- Sure. You can talk to me on part 13400 (a port randomly chosen between media_start and media_end of the phone).
So now the SIP phone opens a connection to Asterisk on port 13400 and Asterisk opens another connection to the phone on port 10231.
Essentially, the SIP phone opens two connection to Asterisk - port 5060 (SIP) and port 13400. Asterisk opens up one connection to SIP phone - port 10231.
You have the first part right, but I think you are a bit confused about UDP. UDP doesn’t really open up ‘connections’. UDP is a non reliable transport mechanism (unlike TCP). Messages are more or less just sent to an IP:Port and if the other side accepts the message it may or may not respond.
In a VoIP call utilizing SIP protocol there are always two ports on each side. The signalling (SIP) port which is used to set up and tear down the call, and the media port which is used to transmit the RTP stream.
I would highly suggest reading some SIP tutorials to get a better understanding of the protocol and how everything comes together.