This topic discusses the forwarding capabilities in the RTC Client API version 1.2.
Forwarding an Incoming Call
An RTC Client API version 1.2 application can forward incoming calls while the session state is RTCSS_INCOMING, provided the session type is RTCST_PC_PC, RTCST_PC_PHONE, or RTCST_MULTIPARTY_IM. The IRTCSessionCallControl::Forward method will forward the call to the specified URI unless the URI is the party that created the call. The call is then declined and the session state returns to RTCSS_DISCONNECTED.
Forwarding with Confirmation
The application has two options to choose from when a call that it initiates is forwarded: automatically allow the redirected call to occur, or receive notification of the incoming redirection. The IRTCClient::CreateSession method takes an RTCCS_ flags parameter that allows or disallows the session to be forwarded automatically. The application will be notified of a redirected call only if the RTCCS_FAIL_ON_REDIRECT flag is set to TRUE when the session is created. If the RTCCS_FAIL_ON_REDIRECT flag is set to FALSE, the application is not notified that the redirection occurred and the call proceeds as usual.
If the fail on redirect flag is in the TRUE state, the application will be notified of the attempt to forward the call with an IRTCSessionStateChangeEvent. The session state changes to RTCSS_DISCONNECTED and the returned status code is RTC_E_STATUS_REDIRECTED_MOVED_TEMPORARILY, which indicates that the session failed due to redirect. The session object can be retrieved from the IRTCSessionStateChangeEvent, and the application can then call IRTCSession::NextRedirectedUser, IRTCSession::get_RedirectedUserName, and IRTCSession::get_RedirectedUserURI to obtain the user name and URI that the call was forwarded to. The user then decides whether to create a new session to call this URI.