IRTCClient::CreateSession (Windows CE 5.0)

Send Feedback

This method creates a session.

HRESULT CreateSession(RTC_SESSION_TYPEenType,BSTRbstrLocalPhoneURI,IRTCProfile* pProfile,longlFlags,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 Values

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 CE does not support the video or T120 media types, so the following sequence of steps do not work without change on Windows 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

OS Versions: Windows CE .NET 4.0 and later.
Header: Rtccore.h, Rtccore.idl.
Link Library: Uuid.lib.

See Also

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

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.