public void Set(string addressOfRecord, string[] contacts) { lock (this.m_pOwner.Server.LockSynchronizer) { string text = ""; for (int i = 0; i < contacts.Length; i++) { if (i == contacts.Length - 1) { text += contacts[i]; } else { text = text + contacts[i] + "\t"; } } this.m_pOwner.Server.TCP_Client.TcpStream.WriteLine(string.Concat(new string[] { "SetSipRegistration ", TextUtils.QuoteString(this.m_pOwner.VirtualServerID), " ", TextUtils.QuoteString(addressOfRecord), " ", TextUtils.QuoteString(text) })); string text2 = this.m_pOwner.Server.ReadLine(); if (!text2.ToUpper().StartsWith("+OK")) { throw new Exception(text2); } SipRegistration sipRegistration = new SipRegistration(this, "administrator", addressOfRecord, new SipRegistrationContact[0]); this.m_pRegistrations.Add(sipRegistration); sipRegistration.Refresh(); } }
public void Remove(SipRegistration registration) { lock (this.m_pOwner.Server.LockSynchronizer) { Guid.NewGuid().ToString(); this.m_pOwner.Server.TCP_Client.TcpStream.WriteLine("DeleteSipRegistration " + TextUtils.QuoteString(this.m_pOwner.VirtualServerID) + " " + TextUtils.QuoteString(registration.AddressOfRecord)); string text = this.m_pOwner.Server.ReadLine(); if (!text.ToUpper().StartsWith("+OK")) { throw new Exception(text); } this.m_pRegistrations.Remove(registration); } }