예제 #1
0
파일: Xmpp.cs 프로젝트: filiperamon/Beet
        void SessionInitiateCallback(object sender, XPathEventArgs e)
        {
            try
            {
                Iq iqIn = (Iq)e.Stanza;
                if (iqIn.Type != IqType.Error)
                {
                    Log.Info("<SessionInitiate");


                    Messaging.Jingle.JingleSdp jingleIn = null;

                    // jingleIn = (Messaging.Jingle.JingleSdp) iqIn.Query;
                    jingleIn = iqIn.Element <Messaging.Jingle.JingleSdp>();

                    this.SendAck(iqIn.From, iqIn.Id);
                    if (this.OnReceiveSessionInitiate != null)
                    {
                        this.OnReceiveSessionInitiate(this, new Messaging.Jingle.JingleSdpEventArgs(iqIn.From, jingleIn.ToSdp()));
                    }
                }
                else
                {
                    Log.Error("SessionInitiateCallback Error");
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
        }
예제 #2
0
파일: Xmpp.cs 프로젝트: filiperamon/Beet
        void SessionAcceptCallback(object sender, XPathEventArgs e)
        {
            try
            {
                Log.Info("<SessionAccept");

                Iq iqIn = (Iq)e.Stanza;
                Messaging.Jingle.JingleSdp jingleIn = null;

                // jingleIn = (Messaging.Jingle.JingleSdp) iqIn.Query;
                jingleIn = iqIn.Element <Messaging.Jingle.JingleSdp>();

                this.SendAck(iqIn.From, iqIn.Id);
                // This event needs to get passed back up to IceLink.Conference.OnReceiveOfferAnswer
                if (this.OnReceiveSessionAccept != null)
                {
                    Log.Info("Raising OnReceiveSessionAccept");
                    this.OnReceiveSessionAccept(this, new Messaging.Jingle.JingleSdpEventArgs(iqIn.From, jingleIn.ToSdp()));
                }
                else
                {
                    Log.Info("No OnReceiveSessionAccept handler");
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
        }
예제 #3
0
        void ServiceDiscovery(object sender, XPathEventArgs e)
        {
            Console.WriteLine("<ServiceDiscovery");

            Matrix.Xmpp.Client.Iq xIq = (Matrix.Xmpp.Client.Iq)e.Stanza;

            Matrix.Xmpp.Client.Iq iq = new Matrix.Xmpp.Client.Iq();
            iq.From = this.jid;
            iq.To   = "[email protected]/" + this.session;
            iq.Type = Matrix.Xmpp.IqType.Result;
            iq.Id   = xIq.Id;
            string defaultNs = "http://jabber.org/protocol/disco#info";

            iq.Query = new Matrix.Xml.XmppXElement(defaultNs, "query", new System.Xml.Linq.XAttribute("node", xIq.Query.GetAttribute("node")));
            iq.Query.Add(new Matrix.Xml.XmppXElement(defaultNs, "identity", new System.Xml.Linq.XAttribute("category", "client"), new System.Xml.Linq.XAttribute("name", "legion-0.1"), new System.Xml.Linq.XAttribute("type", "pc")));

            iq.Query.Add(new Matrix.Xml.XmppXElement(defaultNs, "feature", new System.Xml.Linq.XAttribute("var", "http://jabber.org/protocol/caps")));
            iq.Query.Add(new Matrix.Xml.XmppXElement(defaultNs, "feature", new System.Xml.Linq.XAttribute("var", "http://jabber.org/protocol/disco#info")));
            iq.Query.Add(new Matrix.Xml.XmppXElement(defaultNs, "feature", new System.Xml.Linq.XAttribute("var", "urn:ietf:rfc:3264")));
            iq.Query.Add(new Matrix.Xml.XmppXElement(defaultNs, "feature", new System.Xml.Linq.XAttribute("var", "urn:xmpp:jingle:apps:dtls:0")));
            iq.Query.Add(new Matrix.Xml.XmppXElement(defaultNs, "feature", new System.Xml.Linq.XAttribute("var", "urn:xmpp:jingle:transports:ice-udp:1")));
            iq.Query.Add(new Matrix.Xml.XmppXElement(defaultNs, "feature", new System.Xml.Linq.XAttribute("var", "urn:xmpp:jingle:apps:rtp:audio")));
            iq.Query.Add(new Matrix.Xml.XmppXElement(defaultNs, "feature", new System.Xml.Linq.XAttribute("var", "urn:xmpp:jingle:apps:rtp:video")));

            this.xmppClient.Send(iq);
        }
예제 #4
0
        void SessionTerminateCallback(object sender, XPathEventArgs e)
        {
            Console.WriteLine("<SessionTerminate");

            Iq iqIn = (Iq)e.Stanza;

            // send ack
            this.SendAck(iqIn.From, iqIn.Id);
        }
예제 #5
0
        void SessionInitiateCallback(object sender, XPathEventArgs e)
        {
            Console.WriteLine("<SessionInitiate");

            Iq iqIn = (Iq)e.Stanza;

            Messaging.Jingle.JingleSdp jingleIn = (Messaging.Jingle.SdpJingle)iqIn.Query;

            this.SendAck(iqIn.From, iqIn.Id);
            string sdp;


            if (this.OnOfferAnswer != null)
            {
                this.OnOfferAnswer(this, new System.EventArgs());
            }
        }
예제 #6
0
파일: Xmpp.cs 프로젝트: filiperamon/Beet
        void SessionTerminateCallback(object sender, XPathEventArgs e)
        {
            try
            {
                Log.Info("<SessionTerminate");

                Iq iqIn = (Iq)e.Stanza;

                this.SendAck(iqIn.From, iqIn.Id);

                if (this.OnReceiveSessionTerminate != null)
                {
                    this.OnReceiveSessionTerminate(this, new Messaging.Jingle.JingleEventArgs(iqIn.From));
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
        }
예제 #7
0
파일: Xmpp.cs 프로젝트: filiperamon/Beet
 void TransportInfoCallback(object sender, XPathEventArgs e)
 {
     Log.Info("<TransportInfo");
 }
예제 #8
0
 void TransportInfoCallback(object sender, XPathEventArgs e)
 {
     Console.WriteLine("<TransportInfo");
 }