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; }
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); } }
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); }
public Contact(SipUri uri, string localName, ContactType contactType) : this(uri, string.Empty, localName, string.Empty, contactType) { }
public Contact(SipUri uri) : this(uri, string.Empty, ContactType.Buddy) { }
public void CreatePortInfo(string[] list) { this.portInfo = LoginHelper.LoadPortInfo(list); this.uri = this.portInfo.HostUri; this.userid = this.portInfo.UserId; }
public Contact FindContact(SipUri uri) { return(this.contactMgr.Find(uri)); }