Class CallPortAllocations
This class assists user agents in managing media ports that have been allocated for a call object.
This method should be used if a user agent is using the MediaPortListManager class to allocate media ports for a call. It is not necessary to use this class if the user agent uses the MediaPortManager class to allocate media ports.
To use this class, construct an instance of this class and save it with the call object. Then call the AddAllocatedPortsFromSdp() method when the user agent constructs an Sdp object for that call. If the user agent adds media to the call then it must call the AddAllocatedPortsFromMediaDescription() method for each media being added to the call. When the call ends, the user agent must call the FreeAllocatedPorts() method.
Inherited Members
Namespace: SipLib.Media
Assembly: SipLib.dll
Syntax
public class CallPortAllocations
Constructors
| Edit this page View SourceCallPortAllocations(IMediaPortManager)
Constructor.
Declaration
public CallPortAllocations(IMediaPortManager mediaPortManager)
Parameters
| Type | Name | Description |
|---|---|---|
| IMediaPortManager | mediaPortManager | IMediaportManager object to use for freeing allocated ports for the call. |
Methods
| Edit this page View SourceAddAllocatedPortsFromMediaDescription(MediaDescription)
Call this method when the user agent is adding media to a call.
Declaration
public void AddAllocatedPortsFromMediaDescription(MediaDescription mediaDescription)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaDescription | mediaDescription | MediaDescription for the media type being added to the call. |
AddAllocatedPortsFromSdp(Sdp)
Call this method when an Sdp object is created for a call either to offer media for an outgoing call or to answer media offered for a incoming call.
Declaration
public void AddAllocatedPortsFromSdp(Sdp sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| Sdp | sdp | Sdp containing the offered or answered media for a call. |
FreeAllocatedPorts()
Frees all ports that have been allocated for a call. This method must be called when the call ends.
Declaration
public void FreeAllocatedPorts()