Why does Asterisk open a second media port +1 above the other?
Clash Royale CLAN TAG#URR8PPP
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?
networking asterisk
add a comment |
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?
networking asterisk
SIP trunk to provider?
– Rui F Ribeiro
Jan 12 at 1:06
add a comment |
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?
networking asterisk
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?
networking asterisk
networking asterisk
edited Jan 12 at 1:04
Rui F Ribeiro
39.6k1479132
39.6k1479132
asked Jan 11 at 23:35
MD-7MD-7
1336
1336
SIP trunk to provider?
– Rui F Ribeiro
Jan 12 at 1:06
add a comment |
SIP trunk to provider?
– Rui F Ribeiro
Jan 12 at 1:06
SIP trunk to provider?
– Rui F Ribeiro
Jan 12 at 1:06
SIP trunk to provider?
– Rui F Ribeiro
Jan 12 at 1:06
add a comment |
2 Answers
2
active
oldest
votes
That will be your RTCP stream. See your SDP.
That's exactly what it is. Lesson learned to go through my SDP more carefully before looking elsewhere. Thank you.
– MD-7
Jan 18 at 18:03
add a comment |
I’ve only ever seen SIP calls use unidirectional UDP RTP audio streams, so you would need 2 for each leg.
You've already used Wireshark to capture a SIP call - the Telphony menu offers some VoIP specific analysis tools - you could try showing SIP streams in the capture you made above - that will show the call signalling. Showing RTP streams will show the media streams you were asking about. Selecting a stream and clicking Analyze will pop up a dialog box with a lot of packet data and a button for Play Streams. You'll likely find each stream in your capture will contain one side of the conversation.
For two-way communication over a single port, I’m guessing you were thinking about IAX / IAX2, which was developed by the Asterisk project.
From https://www.voip-info.org/iax/
The IAX revision 2 protocol was developed by Asterisk team as alternative to SIP, H.323, etc. when connecting to other devices that support IAX (a limited list at the moment, but growing very rapidly).
...
IAX2 uses a single UDP port 4569, and thus works well in NAT environments (the obsolete IAX1 protocol used port 5036). IAX2 uses ONLY one udp port for both control and data traffic. As outlined in point 4 of the IAX versus SIP topic with IAX you will always have audio if the control connection can be established.
Thank you for your well thought out answer. Your comment is interesting about the unidirectional RTP streams. If each call leg needs two ports for audio, where can I see this happening in my analysis? The wireshark flow sequence above shows the entire flow for that leg, and I only see one port (5854). Shouldn't the other port also be seen here in some way (whether it is the sending/receiving port)?
– MD-7
Jan 18 at 18:11
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f494047%2fwhy-does-asterisk-open-a-second-media-port-1-above-the-other%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
That will be your RTCP stream. See your SDP.
That's exactly what it is. Lesson learned to go through my SDP more carefully before looking elsewhere. Thank you.
– MD-7
Jan 18 at 18:03
add a comment |
That will be your RTCP stream. See your SDP.
That's exactly what it is. Lesson learned to go through my SDP more carefully before looking elsewhere. Thank you.
– MD-7
Jan 18 at 18:03
add a comment |
That will be your RTCP stream. See your SDP.
That will be your RTCP stream. See your SDP.
answered Jan 12 at 1:28
JdeBPJdeBP
34.2k469161
34.2k469161
That's exactly what it is. Lesson learned to go through my SDP more carefully before looking elsewhere. Thank you.
– MD-7
Jan 18 at 18:03
add a comment |
That's exactly what it is. Lesson learned to go through my SDP more carefully before looking elsewhere. Thank you.
– MD-7
Jan 18 at 18:03
That's exactly what it is. Lesson learned to go through my SDP more carefully before looking elsewhere. Thank you.
– MD-7
Jan 18 at 18:03
That's exactly what it is. Lesson learned to go through my SDP more carefully before looking elsewhere. Thank you.
– MD-7
Jan 18 at 18:03
add a comment |
I’ve only ever seen SIP calls use unidirectional UDP RTP audio streams, so you would need 2 for each leg.
You've already used Wireshark to capture a SIP call - the Telphony menu offers some VoIP specific analysis tools - you could try showing SIP streams in the capture you made above - that will show the call signalling. Showing RTP streams will show the media streams you were asking about. Selecting a stream and clicking Analyze will pop up a dialog box with a lot of packet data and a button for Play Streams. You'll likely find each stream in your capture will contain one side of the conversation.
For two-way communication over a single port, I’m guessing you were thinking about IAX / IAX2, which was developed by the Asterisk project.
From https://www.voip-info.org/iax/
The IAX revision 2 protocol was developed by Asterisk team as alternative to SIP, H.323, etc. when connecting to other devices that support IAX (a limited list at the moment, but growing very rapidly).
...
IAX2 uses a single UDP port 4569, and thus works well in NAT environments (the obsolete IAX1 protocol used port 5036). IAX2 uses ONLY one udp port for both control and data traffic. As outlined in point 4 of the IAX versus SIP topic with IAX you will always have audio if the control connection can be established.
Thank you for your well thought out answer. Your comment is interesting about the unidirectional RTP streams. If each call leg needs two ports for audio, where can I see this happening in my analysis? The wireshark flow sequence above shows the entire flow for that leg, and I only see one port (5854). Shouldn't the other port also be seen here in some way (whether it is the sending/receiving port)?
– MD-7
Jan 18 at 18:11
add a comment |
I’ve only ever seen SIP calls use unidirectional UDP RTP audio streams, so you would need 2 for each leg.
You've already used Wireshark to capture a SIP call - the Telphony menu offers some VoIP specific analysis tools - you could try showing SIP streams in the capture you made above - that will show the call signalling. Showing RTP streams will show the media streams you were asking about. Selecting a stream and clicking Analyze will pop up a dialog box with a lot of packet data and a button for Play Streams. You'll likely find each stream in your capture will contain one side of the conversation.
For two-way communication over a single port, I’m guessing you were thinking about IAX / IAX2, which was developed by the Asterisk project.
From https://www.voip-info.org/iax/
The IAX revision 2 protocol was developed by Asterisk team as alternative to SIP, H.323, etc. when connecting to other devices that support IAX (a limited list at the moment, but growing very rapidly).
...
IAX2 uses a single UDP port 4569, and thus works well in NAT environments (the obsolete IAX1 protocol used port 5036). IAX2 uses ONLY one udp port for both control and data traffic. As outlined in point 4 of the IAX versus SIP topic with IAX you will always have audio if the control connection can be established.
Thank you for your well thought out answer. Your comment is interesting about the unidirectional RTP streams. If each call leg needs two ports for audio, where can I see this happening in my analysis? The wireshark flow sequence above shows the entire flow for that leg, and I only see one port (5854). Shouldn't the other port also be seen here in some way (whether it is the sending/receiving port)?
– MD-7
Jan 18 at 18:11
add a comment |
I’ve only ever seen SIP calls use unidirectional UDP RTP audio streams, so you would need 2 for each leg.
You've already used Wireshark to capture a SIP call - the Telphony menu offers some VoIP specific analysis tools - you could try showing SIP streams in the capture you made above - that will show the call signalling. Showing RTP streams will show the media streams you were asking about. Selecting a stream and clicking Analyze will pop up a dialog box with a lot of packet data and a button for Play Streams. You'll likely find each stream in your capture will contain one side of the conversation.
For two-way communication over a single port, I’m guessing you were thinking about IAX / IAX2, which was developed by the Asterisk project.
From https://www.voip-info.org/iax/
The IAX revision 2 protocol was developed by Asterisk team as alternative to SIP, H.323, etc. when connecting to other devices that support IAX (a limited list at the moment, but growing very rapidly).
...
IAX2 uses a single UDP port 4569, and thus works well in NAT environments (the obsolete IAX1 protocol used port 5036). IAX2 uses ONLY one udp port for both control and data traffic. As outlined in point 4 of the IAX versus SIP topic with IAX you will always have audio if the control connection can be established.
I’ve only ever seen SIP calls use unidirectional UDP RTP audio streams, so you would need 2 for each leg.
You've already used Wireshark to capture a SIP call - the Telphony menu offers some VoIP specific analysis tools - you could try showing SIP streams in the capture you made above - that will show the call signalling. Showing RTP streams will show the media streams you were asking about. Selecting a stream and clicking Analyze will pop up a dialog box with a lot of packet data and a button for Play Streams. You'll likely find each stream in your capture will contain one side of the conversation.
For two-way communication over a single port, I’m guessing you were thinking about IAX / IAX2, which was developed by the Asterisk project.
From https://www.voip-info.org/iax/
The IAX revision 2 protocol was developed by Asterisk team as alternative to SIP, H.323, etc. when connecting to other devices that support IAX (a limited list at the moment, but growing very rapidly).
...
IAX2 uses a single UDP port 4569, and thus works well in NAT environments (the obsolete IAX1 protocol used port 5036). IAX2 uses ONLY one udp port for both control and data traffic. As outlined in point 4 of the IAX versus SIP topic with IAX you will always have audio if the control connection can be established.
edited Jan 13 at 1:47
answered Jan 12 at 2:50
Adam JohnsonAdam Johnson
316
316
Thank you for your well thought out answer. Your comment is interesting about the unidirectional RTP streams. If each call leg needs two ports for audio, where can I see this happening in my analysis? The wireshark flow sequence above shows the entire flow for that leg, and I only see one port (5854). Shouldn't the other port also be seen here in some way (whether it is the sending/receiving port)?
– MD-7
Jan 18 at 18:11
add a comment |
Thank you for your well thought out answer. Your comment is interesting about the unidirectional RTP streams. If each call leg needs two ports for audio, where can I see this happening in my analysis? The wireshark flow sequence above shows the entire flow for that leg, and I only see one port (5854). Shouldn't the other port also be seen here in some way (whether it is the sending/receiving port)?
– MD-7
Jan 18 at 18:11
Thank you for your well thought out answer. Your comment is interesting about the unidirectional RTP streams. If each call leg needs two ports for audio, where can I see this happening in my analysis? The wireshark flow sequence above shows the entire flow for that leg, and I only see one port (5854). Shouldn't the other port also be seen here in some way (whether it is the sending/receiving port)?
– MD-7
Jan 18 at 18:11
Thank you for your well thought out answer. Your comment is interesting about the unidirectional RTP streams. If each call leg needs two ports for audio, where can I see this happening in my analysis? The wireshark flow sequence above shows the entire flow for that leg, and I only see one port (5854). Shouldn't the other port also be seen here in some way (whether it is the sending/receiving port)?
– MD-7
Jan 18 at 18:11
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f494047%2fwhy-does-asterisk-open-a-second-media-port-1-above-the-other%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
SIP trunk to provider?
– Rui F Ribeiro
Jan 12 at 1:06