Class MediaPortListManager
Class for managing allocation of UDP and TCP ports for audio, video, RTT and MSRP media. This class allocates ports from a list of available ports and frees the allocated ports by returning them to the list when a call ends.
User agents that use this class are responsible for freeing allocated ports by calling one of the Free*() methods.
Implements
Inherited Members
Namespace: SipLib.Media
Assembly: SipLib.dll
Syntax
public class MediaPortListManager : IMediaPortManager
Constructors
| Edit this page View SourceMediaPortListManager(MediaPortSettings)
Constructor
Declaration
public MediaPortListManager(MediaPortSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaPortSettings | settings | Specifies the port ranges to allocate for each media type. |
Properties
| Edit this page View SourceNextAudioPort
Gets the next available port for video media.
Declaration
public int NextAudioPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
NextMsrpPort
Gets the next available port for MSRP media.
Declaration
public int NextMsrpPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
NextRttPort
Gets the next available port for RTT media.
Declaration
public int NextRttPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
NextVideoPort
Gets the next available port for video media.
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. |
GetFreePortCount(string)
Gets the current number of free media ports. This method is for diagnostic purposes only.
Declaration
public int GetFreePortCount(string mediaType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mediaType | Type of media to get the free port count for. For example MediaTypes.Audio. |
Returns
| Type | Description |
|---|---|
| int | Returns the number of free media ports. |