private void Register_Click(object sender, EventArgs e) { if (m_opalContext != null) { Register.Enabled = false; host.Enabled = false; user.Enabled = false; password.Enabled = false; OpalMessagePtr msg = new OpalMessagePtr(OpalMessageType.OpalCmdRegistration); OpalParamRegistration reg = msg.GetRegistrationParams(); reg.protocol = "sip"; reg.hostName = host.Text; reg.identifier = user.Text; reg.password = password.Text; reg.timeToLive = 300; OpalMessagePtr result = new OpalMessagePtr(); if (m_opalContext.SendMessage(msg, result)) { m_registrationIdentifier = result.GetRegistrationParams().identifier; return; } MessageBox.Show("Could not start registration: " + result.GetCommandError(), "OPAL", MessageBoxButtons.OK); Register.Enabled = true; host.Enabled = true; user.Enabled = true; password.Enabled = true; } }
public OpalParamRegistration GetRegistrationParams() { global::System.IntPtr cPtr = OPALPINVOKE.OpalMessagePtr_GetRegistrationParams(swigCPtr); OpalParamRegistration ret = (cPtr == global::System.IntPtr.Zero) ? null : new OpalParamRegistration(cPtr, false); return(ret); }
private void Unregister_Click(object sender, EventArgs e) { if (m_opalContext != null) { OpalMessagePtr msg = new OpalMessagePtr(OpalMessageType.OpalCmdRegistration); OpalParamRegistration reg = msg.GetRegistrationParams(); reg.protocol = "sip"; reg.identifier = m_registrationIdentifier; reg.timeToLive = 0; // Zero unregisters OpalMessagePtr result = new OpalMessagePtr(); if (!m_opalContext.SendMessage(msg, result)) { MessageBox.Show("Could not set start registration: " + result.GetCommandError(), "OPAL", MessageBoxButtons.OK); } else { Register.Enabled = false; } } }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(OpalParamRegistration obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
internal static HandleRef getCPtr(OpalParamRegistration obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
internal static HandleRef getCPtr(OpalParamRegistration obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(OpalParamRegistration obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }