Exemplo n.º 1
0
        bool ShouldAcceptSession(string strSession, System.Net.XMPP.Jingle.Jingle jingle)
        {
            ///TODO.. for now only allow outgoing calls
            //StartMicrophoneAndSpeaker();

            //if (AutoAnswer == true)
            //    return true;

            //if (MessageBox.Show(string.Format("Accept new Call from {0}", jingle.Initiator), "New Call", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
            //    return true;
            return(false);
        }
Exemplo n.º 2
0
        //changed this method should have been

/*
 *
 *
 *
 *      bool ShouldAcceptSession(string strSession, System.Net.XMPP.Jingle.Jingle jingle)
 *      {
 *  //        if (m_bCallActive == true) return false;
 *   //       m_bCallActive = true;
 *          ///TODO.. for now only allow outgoing calls
 * //          StartMedia();
 *
 *       //   if (AutoAnswer == true)
 *     //         return true;
 *
 *       // if (MessageBox.Show(string.Format("Accept new Call from {0}", jingle.Initiator), "New Call", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
 *         //     return true;
 *          return false;
 *      }
 */

        bool ShouldAcceptSession(string strSession, System.Net.XMPP.Jingle.Jingle jingle)
        {
            if (m_bCallActive == true)
            {
                return(false);
            }
            m_bCallActive = true;
            ///TODO.. for now only allow outgoing calls
            StartMedia();

            if (AutoAnswer == true)
            {
                return(true);
            }

            if (MessageBox.Show(string.Format("Accept new Call from {0}", jingle.Initiator), "New Call", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
        internal void SendTransportInfo(Jingle jingle)
        {
            TransportInfoRequest = new JingleIQ();
            TransportInfoRequest.From = XMPPClient.JID;
            TransportInfoRequest.To = RemoteJID;
            TransportInfoRequest.Type = IQType.set.ToString();
            TransportInfoRequest.Jingle = jingle;
            TransportInfoRequest.Jingle.Action = Jingle.TransportInfo;
            TransportInfoRequest.Jingle.SID = this.SessionId;

            XMPPClient.SendObject(TransportInfoRequest);
        }
Exemplo n.º 4
0
        internal void SendJingle(Jingle jingleinfo)
        {
            JingleIQ iq = new JingleIQ();
            iq.From = XMPPClient.JID;
            iq.To = RemoteJID;
            iq.Type = IQType.set.ToString();
            iq.Jingle = jingleinfo;
            iq.Jingle.SID = this.SessionId;

            XMPPClient.SendObject(iq);
        }
Exemplo n.º 5
0
        internal void InitiateSession(Jingle jingleinfo, string strJIDTo)
        {
            if (OutgoingRequestMessage != null) /// we've already started a session, the user needs to create a new one
                throw new Exception(string.Format("Cannot initiate a session that already exists, Session [{0}] has already sent out an initiate session message, client must create a new session", this.SessionId));

            RemoteJID = strJIDTo;

            OutgoingRequestMessage = new JingleIQ();
            OutgoingRequestMessage.From = XMPPClient.JID;
            OutgoingRequestMessage.To = RemoteJID;
            OutgoingRequestMessage.Type = IQType.set.ToString();
            OutgoingRequestMessage.Jingle = jingleinfo;
            OutgoingRequestMessage.Jingle.Action = Jingle.SessionInitiate;
            OutgoingRequestMessage.Jingle.Initiator = XMPPClient.JID;
            if (OutgoingRequestMessage.Jingle.SID == null)
               OutgoingRequestMessage.Jingle.SID = Guid.NewGuid().ToString();

            XMPPClient.SendObject(OutgoingRequestMessage);
        }
Exemplo n.º 6
0
        internal void AcceptSession(Jingle jingleinfo)
        {
            if (AcceptSessionMessage != null) /// we've already started a session, the user needs to create a new one
                throw new Exception(string.Format("Cannot accept a session that already exists, Session [{0}] has already been accepted, client must create a new session", this.SessionId));

            AcceptSessionMessage = new JingleIQ();
            AcceptSessionMessage.From = XMPPClient.JID;
            AcceptSessionMessage.To = RemoteJID;
            AcceptSessionMessage.Type = IQType.set.ToString();
            AcceptSessionMessage.Jingle = jingleinfo;
            AcceptSessionMessage.Jingle.Action = Jingle.SessionAccept;
            //AcceptSessionMessage.Jingle.Initiator = XMPPClient.JID;
            AcceptSessionMessage.Jingle.SID = this.SessionId;

            XMPPClient.SendObject(AcceptSessionMessage);
        }