NO Dicko, I wasn’t talking about the rtcp port.
Please refer to the following:
User Datagram Protocol - Wikipedia
“… The UDP datagram header consists of 4 fields, each of which is 2 bytes (16 bits):[3]… Source port number
This field identifies the sender’s port, when used, and should be assumed to be the port to reply to if needed. If not used, it should be zero. If the source host is the client, the port number is likely to be an ephemeral port. If the source host is the server, the port number is likely to be a well-known port number from 0 to 1023.[6]
Destination port number
This field identifies the receiver’s port and is required…”
So, in rtp (not rtcp) the reception port - that is the destination port - the port that is used by the receiving peer - I am assuming THAT is negotiated in SIP?
Note the following:
RTP: Some Frequently Asked Questions about RTP (columbia.edu)
" Each side in a bidirectional RTP session assigns their source ports independently, i.e., there is no assumption that if Alice sends audio to Bob on port 5000 (and RTCP on 5001), Alice also has to receive audio on port 5000. (Imposing such a restriction on ports would make it difficult for a host to participate in several independent RTP sessions using different tools.) Each side in a unicast session simply indicates to the other side where it wants to receive RTP packets, e.g., using SDP."
So, for example:
The 7941G phone is configured to use a rtp port of 16384-32766, Asterisk is configured to use a range of 10000-20000
Therefore, after call setup, the UDP packets in the rtp datastream that originate from Asterisk will have a source port of anything in between 10000-20000 and a destination port of 16384-32766, the UDP packets in the rtp datastream that originate from the 7941G will have a source port of anything in between 16384-32766 and a destination port of 10000-20000, the UDP packets in the rtcp datastream that originate from Asterisk will have a source port of 10001-20001 and a destination port of 16385-32767, the UDP packets in the rtcp datastream that originate from the 7941G will have a source port of 16385-32767 and a destination port of 10001-20001
Asterisk therefore is ONLY using the 10000-20000 directive to control the SOURCE port in its rtp packets that it’s sending, the DESTINATION port in the packets it’s sending is negotiated by the phone and will be between 16384-32766
The phone therefore is ONLY using the 16384-32766 directive to control the SOURCE port in it’s rtp packets it’s sending, the DESTINATION port in the packets it’s sending is negotiated by Asterisk and will be between 10000-20000
Asterisk therefore is ONLY using the 10000-20000 directive (effectively 10001-20001 due to rtcp being +1) to control the SOURCE port in its rtcp packets that it’s sending, the DESTINATION port in the packets it’s sending is negotiated by the phone and will be between 16385-32767
The phone therefore is ONLY using the 16384-32766 directive (effectively 16385-32767 due to rtcp being +1) to control the SOURCE port in it’s rtcp packets it’s sending, the DESTINATION port in the packets it’s sending is negotiated by Asterisk and will be between 10001-20001
Asterisk being symmectric means that if it’s sending an rtp packet with a source port of say 10000 and an rtcp packet with a source port of 10001, it will have told the phone to send it rtp packets with destination ports of 10000 and rtcp packets with destination ports of 10001
I cannot find a detailed description of RTP protocol negotiation in SIP that describes this - but it is vitally important to know what’s going on if you are attempting to create large rtp port forward ranges in a NAT or firewall that isn’t dynamically inspecting the SIP rtp / rtcp packets and opening pinholes or dynamically forwarding them (the so-called ALG)