Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The following code example shows how to make a call. The session is created, then a participant is added to the session to initiate the call. The operations in the Initialize RTC example must be performed before using this code.
**Note **This code has not been thoroughly tested, does not contain error checking, and is not intended for production use.
HRESULT hr = S_OK;
BSTR bstrLocalURI = NULL;
BSTR bstrDestURI = NULL;
RTC_SESSION_TYPE SessionType;
SessionType = // Specify session type
// For phone-phone sessions, the local telephone URI is required.
if (SessionType == RTCST_PHONE_TO_PHONE)
{
bstrLocalURI = SysAllocString(_T("tel:+14257034556"));
}
// Get the URI to call; this can be a SIP or a TEL URI.
bstrDestURI = SysAllocString(_T("sip:[email protected]"));
// Create the session with the specified session type and local URI.
hr = pIRTCClient->CreateSession( SessionType,
bstrLocalURI,
NULL,
&pIRTCSession );
// if (hr != S_OK) process error here.
// The AddParticipant method sets the session into the active state
// and creates the IRTCParticipant interface.
IRTCParticipant *pIRTCParticipant;
hr = pIRTCSession->AddParticipant( bstrDestURI,
NULL,
&pIRTCParticipant );
// if (hr != S_OK) process error here.
See Also
Send Feedback on this topic to the authors