Beispiel #1
0
        public Conversation(BaseSipConnection connection, SipMessage packet)
        {
            this.connection = connection;
            this.callID     = int.Parse(packet.CallID.Value);
            this.cseq       = packet.CSeq.Value;
            this.from       = new SipUri(packet.From.Value);
            string eventStr = (packet.Event == null ? SipEvent.None.ToString() : packet.Event.Value);

            if (Enum.IsDefined(typeof(SipEvent), eventStr))
            {
                this.eventName = (SipEvent)Enum.Parse(typeof(SipEvent), eventStr, true);
            }
            this.originPacket = packet;
        }
Beispiel #2
0
        public void RcvPacket(SipMessage packet)
        {
            SipRequest req = packet as SipRequest;

            if (req != null)
            {
                if (req[SipHeadFieldName.From] != null)
                {
                    this.from = new SipUri(req[SipHeadFieldName.From].Value);
                }
                this.RcvRequest(req);
            }
            else
            {
                this.RcvResponse(packet as SipResponse);
            }
        }
Beispiel #3
0
        public void Load(string[] list)
        {
            this.ssic = list[0].Replace("ssic=", string.Empty);
            TextReader        reader = new StringReader(list[1]);
            XPathDocument     doc    = new XPathDocument(reader);
            XPathNavigator    nav    = ((IXPathNavigable)doc).CreateNavigator();
            XPathNodeIterator iter   = nav.Select("//@uri");

            iter.MoveNext();
            this.hostUri = new SipUri(iter.Current.Value);

            iter = nav.Select("//@user-id");
            iter.MoveNext();
            this.userid = iter.Current.Value.Trim();

            iter = nav.Select("//results/user/credentials/credential[1]");
            iter.MoveNext();
            this.domain = iter.Current.GetAttribute("domain", string.Empty);

            iter = nav.Select("//results/user/credentials/credential[1]");
            iter.MoveNext();
            this.credential = iter.Current.GetAttribute("c", string.Empty);
        }
Beispiel #4
0
 public Contact(SipUri uri, string localName, ContactType contactType)
     : this(uri, string.Empty, localName, string.Empty, contactType)
 {
 }
Beispiel #5
0
 public Contact(SipUri uri)
     : this(uri, string.Empty, ContactType.Buddy)
 {
 }
Beispiel #6
0
 public void CreatePortInfo(string[] list)
 {
     this.portInfo = LoginHelper.LoadPortInfo(list);
     this.uri      = this.portInfo.HostUri;
     this.userid   = this.portInfo.UserId;
 }
Beispiel #7
0
 public Contact FindContact(SipUri uri)
 {
     return(this.contactMgr.Find(uri));
 }