Class MediaPortManager
Class for managing allocation of UDP and TCP ports for audio, video, RTT and MSRP media.
This class increments port numbers within a specified range of ports. When the last port in a range is allocated, this class wraps around to the starting port number.
There is no need for the user agent using this class to free ports that have been used for a call.
Implements
Inherited Members
Namespace: SipLib.Media
Assembly: SipLib.dll
Syntax
public class MediaPortManager : IMediaPortManager
Constructors
| Edit this page View SourceMediaPortManager(MediaPortSettings)
Constructor
Declaration
public MediaPortManager(MediaPortSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaPortSettings | settings | Media port range allocations for each type of media. |
Properties
| Edit this page View SourceNextAudioPort
Gets the next port to use for audio media. The return value is for audio media. The return value + 1 may be used for RTCP for the audio stream.
Declaration
public int NextAudioPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
NextMsrpPort
Gets the next port to use for MSRP media. RTCP is not used for MSRP so only the return value may be used for the MSRP media.
Declaration
public int NextMsrpPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
NextRttPort
Gets the next port to use for RTT media. The return value is for RTT media. The return value + 1 may be used for RTCP for the RTT stream.
Declaration
public int NextRttPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
NextVideoPort
Gets the next port to use for video media. The return value is for video media. The return value + 1 may be used for RTCP for the video stream.
Declaration
public int NextVideoPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceFreeAudioPort(int)
Frees an audio port.
Declaration
public void FreeAudioPort(int port)
Parameters
| Type | Name | Description |
|---|---|---|
| int | port | Port that was allocated for audio. |
FreeMediaPort(string, int)
Frees a media port for the specified media type.
Declaration
public void FreeMediaPort(string mediaType, int port)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mediaType | Media type that the port was allocated for. Must be equal to one of the value specified in the MediaTypes class. |
| int | port | Port that was allocated for the specified media type. |
FreeMsrpPort(int)
Frees a MSRP port.
Declaration
public void FreeMsrpPort(int port)
Parameters
| Type | Name | Description |
|---|---|---|
| int | port | Port that was |
FreeRttPort(int)
Frees a RTT port.
Declaration
public void FreeRttPort(int port)
Parameters
| Type | Name | Description |
|---|---|---|
| int | port | Port that was allocated for RTT. |
FreeVideoPort(int)
Frees a video port.
Declaration
public void FreeVideoPort(int port)
Parameters
| Type | Name | Description |
|---|---|---|
| int | port | Port that was allocated for video. |