Send a Reinvite on a Connected Application Session

The following code examples demonstrate how to send a reinvite on a connected application session (RTCST_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

IRTCSession2    *pIRTCSession2          = NULL;
BSTR            bstrContentType         = SysAllocString(L"application/sdp");
BSTR            bstrSessionDescription  = // Specify the Session Description ;
long            lCookie                 = // Specify the cookie value;

// Send an outgoing Reinvite.
hr = pIRTCSession2->ReInviteWithSessionDescription(bstrContentType,
                                                   bstrSessionDescription,
                                                   lCookie);

// if (hr != S_OK) process error here 

// Wait for the RTCE_SESSION_OPERATION_COMPLETE event.
// The StatusCode of the event indicates whether the 
// Reinvite attempt was successful or not.

Visual Basic Code Example

Dim objSession2 As IRTCSession2
Dim strContentType As String            '(for example, application/sdp)
Dim strSessionDescription As String     '(Specify the Session Description)
Dim lCookie as Long                     '(Specify the cookie)

' Send an outgoing Reinvite.
objSession2.ReInviteWithSessionDescription(strContentType, _
                                           strSessionDescription, _
                                           lCookie)

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

' Wait for the RTCE_SESSION_OPERATION_COMPLETE event.
' The StatusCode of the event will indicate whether 
' the Reinvite attempt was successful or not.