Share via


Accept an Incoming Reinvite on a Connected Application Session

The following code examples demonstrate how to accept an incoming reinvite on a connected application session (RTCSS_APPLICATION). The operations in the Initialize RTC code example, and either the Create an Outgoing Application Session or Accept an Incoming Application Session code example, must be performed before using this example.

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

C++ Code Example

IRTCReInviteEvent   *pIRTCReInviteEvent = NULL;
BSTR      bstrContentType         = SysAllocString(L"application/sdp");
BSTR      bstrSessionDescription  = // Specify the Session Description ;

// Wait for the RTCE_REINVITE event of type RTCRIN_INCOMING 
// and then accept the Reinvite.

hr = pIRTCReInviteEvent->Accept(bstrContentType,
                                bstrSessionDescription);
                                                   
// If (hr != S_OK), process the error here. 

// An RTCE_REINVITE event of type RTCRIN_SUCCEEDED 
// indicates whether the Reinvite was successful.

Visual Basic Code Example

Dim objReInviteEvent As IRTCReInviteEvent
Dim strContentType As String          '(for example, application/sdp)
Dim strSessionDescription As String   '(Specify the Session Description)

' Wait for the RTCE_REINVITE event of type RTCRIN_INCOMING 
' and then accept the Reinvite.

objReInviteEvent.Accept(strContentType, _
                        strSessionDescription)

' If (Err.Number), process the error here. 

' An RTCE_REINVITE event of type RTCRIN_SUCCEEDED 
' indicates whether the Reinvite was successful.