Call Transfer Scenario 2 (Call Transfer Accepted)

The following scenario illustrates the process to attempt a call transfer that is accepted by the transferred party.

A call transfer is attempted and the referred party accepts the transfer.

Party A (transfer initiator) and Party B (transferee) are in session (RTCSS_CONNECTED). A wants to refer B to C (transfer target).

// A refers B to C.
IRTCSessionCallControl::Refer()

// A’s session state changes to refer.
IRTCSessionStateChangeEvent
	(RTCSS_REFER)

// A also gets a session refer status.
IRTCSessionReferStatusEvent
	(RTCSRS_REFERRING)

                                                             // B receives notice that A has referred the session.
                                                             IRTCSessionReferredEvent
                                                             // B accepts the session refer event.  
                                                             IRTCSessionReferredEvent::Accept()

// A is notified that B has accepted the session referral.
IRTCSessionReferStatusEvent
           (RTCSRS_ACCEPTED) 
                                                             // B places A on hold
				                        IRTCSessionCallControl::Hold()

// B has placed the session with A on hold.
// A receives a media stopped event for the hold.
IRTCMediaEvent
	   (RTCMET_STOPPED)  

                                                             // B retrieves the information that A has set for the transfer. 
				                        IRTCSessionReferredEvent::get_ReferredByURI
				                        IRTCSessionReferredEvent::get_ReferCookie
                                                             IRTCSessionReferredEvent::get_ReferToURI

                                                             // B creates a new session with C and sets the 
                                                             // referred information. 
				                        IRTCClient::CreateSession() ReferToURI
				                        IRTCSessionCallControl::put_ReferredByURI()
				                        IRTCSessionCallControl::put_ReferredByCookie()
				                        IRTCSession::AddParticipant()

                                                                                                   // C receives notification of an
                                                                                                   // incoming session. 
							                                   IRTCSessionStateChangeEvent
								                                     (RTCSS_INCOMING)
						                                            IRTCSessionStateChangeEvent::get_session

                                                                                                   // C checks the incoming session to 
                                                                                                   // determine whether it is a referred session.
						                                            IRTCSessionCallControl::get_IsReferred()

                                                                                                   // C accepts the incoming session.
                                                                                                   IRTCSession::Answer
 
                                                               // B is notified that the new session is now connected.
                                                               IRTCSessionStateChangeEvent::get_State (RTCSS_CONNECTED)

                                                               // B sets the session state on the session referred event
                                                               // object to inform A that the session with C is connected.
			   	                          IRTCSessionReferredEvent::SetReferredSessionState
				                                    		(RTCSS_CONNECTED)

// A receives the session refer event indicating that 
//   B has completed the session transfer process.
IRTCSessionReferStatusEvent
	     (RTCSRS_DONE)

// A receives notification that the original session
//  with A has returned to its original state.
IRTCSessionStateChangeEvent
         	(RTCSS_CONNECTED)