コード例 #1
0
        void On_AudioVideoCall_Received(object sender, CallReceivedEventArgs <AudioVideoCall> e)
        {
            //Type checking was done by the platform; no risk of this being any
            // type other than the type expected.
            _audioVideoCall = e.Call;

            // Call: StateChanged: Only hooked up for logging, to show the call
            // state transitions.
            _audioVideoCall.StateChanged += new
                                            EventHandler <CallStateChangedEventArgs>(_audioVideoCall_StateChanged);

            // Remote Participant URI represents the far end (caller) in this
            // conversation. Toast is the message set by the caller as the 'greet'
            // message for this call. In Microsoft Lync, the toast will
            // show up in the lower-right of the screen.
            Console.WriteLine("Call Received! From: " + e.RemoteParticipant.Uri + " Toast is: " +
                              e.ToastMessage.Message);

            // Now, forward the call to the user given above. Forwarding is not
            // an async operation; it completes as soon as the message is sent,
            // without waiting for a reply from the far end.
            _audioVideoCall.Forward(_forwardUserURI);
            _autoResetEvent.Set();
        }