AudioVideoFlow.BeginHold Method (HoldType, AsyncCallback, Object)
Begins to hold the AudioVideoFlow.
Namespace: Microsoft.Rtc.Collaboration.AudioVideo
Assembly: Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)
Syntax
'Declaration
Public Function BeginHold ( _
holdType As HoldType, _
userCallback As AsyncCallback, _
state As Object _
) As IAsyncResult
'Usage
Dim instance As AudioVideoFlow
Dim holdType As HoldType
Dim userCallback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult
returnValue = instance.BeginHold(holdType, _
userCallback, state)
public IAsyncResult BeginHold(
HoldType holdType,
AsyncCallback userCallback,
Object state
)
Parameters
- holdType
Type: Microsoft.Rtc.Collaboration.AudioVideo.HoldType
The type of hold to be used.
- userCallback
Type: System.AsyncCallback
The method to be called when the asynchronous operation is completed.
- state
Type: System.Object
A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.
Return Value
Type: System.IAsyncResult
An IAsyncResult that references the asynchronous operation.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | Thrown when the AudioVideoFlow is not in the Active state or when there is already an asynchronous operation in progress. |
ArgumentOutOfRangeException | Thrown when the holdType argument value is not a value in the HoldType enumerated type. |
Examples
The following example puts the call on hold.
C# Putting a call on hold.
audioVideoFlow.BeginHold(
HoldType.BothEndpoints,
new AsyncCallback(delegate(IAsyncResult result)
{
try
{
audioVideoFlow.EndHold(result);
}
catch (RealTimeException e)
{
// handle exception
throw e;
}
// audioVideoFlow is now on hold
}),
this);