Share via


Session Transfer Rejected

The following code example demonstrates how to reject a session transfer. The operations in the Initialize RTC, Create a Session and Make a Call, and Session Transfer code examples must be performed before using this example.

Note  This example does not contain error checking or releases appropriate for real code.

C++ Code Example

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ON THE TRANSFEREE SIDE ...
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// The IRTCSessionReferredEvent is fired on the Transferee side.

// Declare the session referred event.
IRTCSessionReferredEvent *pEvent = NULL; 

BSTR  bstrReferToURI;
BSTR  bstrReferredByURI;
BSTR  bstrReferCookie;

long  lState;

// Get the IRTCSessionReferredEvent event. For information
// on how to receive events, see the "Handle Events" code
// example.

// The Transferee should call the Reject method when  
// the IRTCSessionReferredEvent is fired.

hr = pEvent->Reject();

// If (hr != S_OK), process the error here.

Visual Basic Code Example

' Set the error handling routine here. 
' On Error GoTo MyErrorRoutine 

' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ON THE TRANSFEREE SIDE ...
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Set the error handling routine here. 
' On Error GoTo MyErrorRoutine 

' Declare the session referred event that is 
' fired on the Transferee side.

Dim objEvent     As IRTCSessionReferredEvent
Dim objSession2  As IRTCSession
Dim strReferToURI As String

' Get the IRTCSessionReferredEvent event. For information
' on how to receive events, see the "Handle Events" code
' example.

' The Transferee should call the Reject method when  
' the IRTCSessionReferredEvent is fired.

pEvent.Reject