IRTCClient::CreateSession

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method creates a session.

Syntax

HRESULT CreateSession(
  RTC_SESSION_TYPE enType,
  BSTR bstrLocalPhoneURI,
  IRTCProfile* pProfile,
  long lFlags,
  IRTCSession** ppSession
);

Parameters

  • enType
    [in] An RTC_SESSION_TYPE enumeration value specifying the type of session to create.
  • bstrLocalPhoneURI
    [in] The local user TEL URI used in phone-to-phone sessions.

    If the session type is not phone-to-phone, this parameter should be set to NULL.

  • pProfile
    [in] Pointer to IRTCProfile for the profile to use for this session.

    If none is specified, the method determines the profile to use for this session.

  • lFlags
    [in] RTCCS_ constants specifying the force profile and fail on redirect settings.
  • ppSession
    [out] Pointer to the new IRTCSession interface.

    This method adds a reference to the Session object, which the caller is responsible for releasing.

Return Value

This method can return an RTC_E_ constant.

Remarks

If a profile is not specified, the RTC Client API determines if a profile is needed for the session based on the SIP URL. If a profile is required, one is chosen from the list of enabled profiles for the session type.

A call to CreateSession for an RTCST_PC_TO_PC or RTCST_PC_TO_PHONE type session fails if the media has been globally disabled.

The media is disabled by initializing the client object using IRTCClient2::InitializeEx, with the RTCIF_DISABLE_MEDIA constant set.

If the application wants to limit the media types allowed on outgoing sessions, it should call the IRTCClient::SetPreferredMediaTypes method to specify the allowed media types.

Windows Embedded CE does not support the video or T120 media types, so the following sequence of steps do not work without change on Windows Embedded CE platforms.

For example, if the application wants to create a PC-to-PC session with only T120 media, but wants to accept incoming calls with audio and video media as well, it should ensure that the preferred media types are set appropriately at the different stages.

The sequence of RTC Client API calls in this case is as follows:

  1. Call SetPreferredMediaTypes specifying RTCMT_T120_SENDRECV in the lMediaTypes parameter.
  2. Call CreateSession and specify RTCST_ PC_TO_PC in the enType parameter.
  3. Call IRTCSession::AddParticipant to connect the session.
  4. Wait for IRTCSessionStateChangeEvent.
    The session state can be either RTCSS_CONNECTED or RTCSS_DISCONNECTED.
  5. Call SetPreferredMediaTypes with the lMediaTypes parameter set to RTCMT_ALL.
    This call ensures that the application can receive incoming audio and video calls.

Requirements

Header rtccore.h, rtccore.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

IRTCClient
IRTCClient::SetPreferredMediaTypes
IRTCClient2::InitializeEx
IRTCProfile
IRTCSession
IRTCSession::AddParticipant
IRTCSessionStateChangeEvent
RTC_SESSION_TYPE