예제 #1
0
        /// <summary>
        /// Attempts to establish a new VoIP call via the Google Voice gateway.
        /// </summary>
        /// <param name="destination">The destination number to call.</param>
        public void Call(MediaManager mediaManager, string destination)
        {
            if (!_isBound)
            {
                throw new ApplicationException("The Google Voice call could not proceed as the XMPP client is not bound.");
            }
            else
            {
                _rtpManager = new RTPManager(true, false);

                // Call to Google Voice over XMPP & Gingle (Google's version of Jingle).
                XMPPPhoneSession phoneSession = m_xmppClient.GetPhoneSession();

                m_xmppCall           = m_xmppClient.GetPhoneSession();
                m_xmppCall.Accepted += XMPPAnswered;
                m_xmppCall.Rejected += XMPPCallFailed;
                m_xmppCall.Hungup   += Hangup;

                // Create the SDP packet to send to GV. Customise it with the ICE credentials that GV require.
                SDP xmppSDP = null; //  _rtpManager.GetSDP(true);
                xmppSDP.IcePwd   = Crypto.GetRandomString(12);
                m_localSTUNUFrag = Crypto.GetRandomString(8);
                xmppSDP.IceUfrag = m_localSTUNUFrag;

                m_xmppCall.PlaceCall(destination + "@" + GOOGLE_VOICE_HOST, xmppSDP);
            }
        }
예제 #2
0
        /// <summary>
        /// This method gets the media manager to pass local media samples to the RTP channel and then
        /// receive them back as the remote video stream. This tests that the codec and RTP packetisation
        /// are working.
        /// </summary>
        public void RunLoopbackTest()
        {
            _rtpManager = new RTPManager(false, true);
            _rtpManager.OnRemoteVideoSampleReady += EncodedVideoSampleReceived;

            var sdp = _rtpManager.GetSDP(false);

            _rtpManager.SetRemoteSDP(sdp);
        }
예제 #3
0
        public void NewCall()
        {
            _audioChannel              = new AudioChannel();
            _audioChannel.SampleReady += AudioChannelSampleReady;

            _rtpManager = new RTPManager(true, _useVideo);
            _rtpManager.OnRemoteVideoSampleReady += EncodedVideoSampleReceived;
            _rtpManager.OnRemoteAudioSampleReady += RemoteAudioSampleReceived;

            if (_audioChannel != null)
            {
                _audioChannel.StartRecording();
            }
        }
예제 #4
0
        public void NewCall()
        {
            _audioChannel = new AudioChannel();
            _audioChannel.SampleReady += AudioChannelSampleReady;

            _rtpManager = new RTPManager(true, true);
            _rtpManager = new RTPManager(true, false);
            _rtpManager.OnRemoteVideoSampleReady += EncodedVideoSampleReceived;
            _rtpManager.OnRemoteAudioSampleReady += RemoteAudioSampleReceived;

            if (_audioChannel != null)
            {
                _audioChannel.StartRecording();
            }
        }
예제 #5
0
        /// <summary>
        /// This method gets the media manager to pass local media samples to the RTP channel and then 
        /// receive them back as the remote video stream. This tests that the codec and RTP packetisation
        /// is working.
        /// </summary>
        public void RunLoopbackTest()
        {
            _rtpManager = new RTPManager(false, true);
            _rtpManager.OnRemoteVideoSampleReady += EncodedVideoSampleReceived;
            _rtpManager.OnRemoteAudioSampleReady += RemoteAudioSampleReceived;

            var sdp = _rtpManager.GetSDP(false);
            _rtpManager.SetRemoteSDP(sdp);
        }
예제 #6
0
        /// <summary>
        /// Attempts to establish a new VoIP call via the Google Voice gateway.
        /// </summary>
        /// <param name="destination">The destination number to call.</param>
        public void Call(MediaManager mediaManager, string destination)
        {
            if (!_isBound)
            {
                throw new ApplicationException("The Google Voice call could not proceed as the XMPP client is not bound.");
            }
            else
            {
                _rtpManager = new RTPManager(true, false);

                // Call to Google Voice over XMPP & Gingle (Google's version of Jingle).
                XMPPPhoneSession phoneSession = m_xmppClient.GetPhoneSession();

                m_xmppCall = m_xmppClient.GetPhoneSession();
                m_xmppCall.Accepted += XMPPAnswered;
                m_xmppCall.Rejected += XMPPCallFailed;
                m_xmppCall.Hungup += Hangup;

                // Create the SDP packet to send to GV. Customise it with the ICE credentials that GV require.
                SDP xmppSDP = null; //  _rtpManager.GetSDP(true);
                xmppSDP.IcePwd = Crypto.GetRandomString(12);
                m_localSTUNUFrag = Crypto.GetRandomString(8);
                xmppSDP.IceUfrag = m_localSTUNUFrag;

                m_xmppCall.PlaceCall(destination + "@" + GOOGLE_VOICE_HOST, xmppSDP);
            }
        }