When placing a call through an Asterisk SIP server, the server will open 2 ports for every media channel:
- 2 ports for call leg 1 video
- 2 ports for call leg 2 video
- 2 ports for call leg 1 audio
- 2 ports for call leg 2 audio
Since Asterisk's media communication is bidirectional, why does it need four ports (2 video, 2 audio) for every call leg as opposed to just 2 (1 video, 1 audio)? It is indeed only using the one port for communication in a particular leg, but
netstat is very clear that there are two ports open, and the second port opened (the allegedly 'unused' port) is always +1 from the used port. For example, the call leg 1 video port is 17744, but it also opens a port 17745.
Wireshark analysis of local traffic:
netstat analysis on Asterisk server:
You can see from the above (partially, I didn't include Wireshark of the other call leg - for brevity) that the same question applies to the audio and video ports of all call legs, so there are four cases of this question per call.
So: Why is there an extra port on the server for each communication path?
Is asterisk not truly bidirectional in its media communication and just forwards the traffic from one port to another?
Also, is this the usual behavior in Asterisk, or might I have something in my configuration that would affect this?