Пример #1
0
        public SIPToXMPPCall(SIPServerUserAgent uas, XMPPPhoneSession xmppCall, SIPTransport sipTransport, IPAddress ipAddress)
        {
            m_uas = uas;
            m_xmppCall = xmppCall;
            m_sipTransport = sipTransport;
            m_ipAddress = ipAddress;

            m_uas.CallCancelled += SIPCallCancelled;
            m_xmppCall.Accepted += Answered;
            m_xmppCall.Rejected += CallFailed;
            m_xmppCall.Hungup += Hangup;
        }
Пример #2
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);
            }
        }