示例#1
0
    public OpalStatusRegistration GetRegistrationStatus()
    {
        global::System.IntPtr  cPtr = OPALPINVOKE.OpalMessagePtr_GetRegistrationStatus(swigCPtr);
        OpalStatusRegistration ret  = (cPtr == global::System.IntPtr.Zero) ? null : new OpalStatusRegistration(cPtr, false);

        return(ret);
    }
示例#2
0
文件: Form1.cs 项目: wwl33695/myopal
        private void HandleOpalMessages()
        {
            OpalMessagePtr msg = new OpalMessagePtr();

            while (m_opalContext.GetMessage(msg, System.UInt32.MaxValue))
            {
                // Handle the message
                switch (msg.GetType())
                {
                case OpalMessageType.OpalIndRegistration:
                    OpalStatusRegistration reg = msg.GetRegistrationStatus();
                    switch (reg.status)
                    {
                    case OpalRegistrationStates.OpalRegisterSuccessful:
                        SetTextSafely(RegisterStatus, "Registration complete to " + reg.serverName);
                        EnableSafely(Unregister, true);
                        break;

                    case OpalRegistrationStates.OpalRegisterRemoved:
                        SetTextSafely(RegisterStatus, "Registration removed from " + reg.serverName);
                        EnableSafely(Unregister, false);
                        EnableSafely(Register, true);
                        EnableSafely(host, true);
                        EnableSafely(user, true);
                        EnableSafely(password, true);
                        break;

                    case OpalRegistrationStates.OpalRegisterFailed:
                        SetTextSafely(RegisterStatus, "Registration failed: " + reg.error);
                        EnableSafely(Register, true);
                        break;
                    }
                    break;

                case OpalMessageType.OpalIndIncomingCall:
                    EnableSafely(Call, false);
                    EnableSafely(Answer, true);
                    EnableSafely(HangUp, true);
                    SetTextSafely(CallStatus, "Incoming call ..." + msg.GetIncomingCall().remoteDisplayName);
                    break;

                case OpalMessageType.OpalIndEstablished:
                    SetTextSafely(CallStatus, "Call established");
                    break;

                case OpalMessageType.OpalIndCallCleared:
                    EnableSafely(Call, true);
                    EnableSafely(Answer, false);
                    EnableSafely(HangUp, false);
                    SetTextSafely(CallStatus, "Call ended: " + msg.GetCallCleared().reason);
                    break;
                }
            }
        }
示例#3
0
        private void HandleOpalMessages()
        {
            OpalMessagePtr msg = new OpalMessagePtr();

            while (m_opalContext.GetMessage(msg, System.UInt32.MaxValue))
            {
                // Handle the message
                switch (msg.GetType())
                {
                case OpalMessageType.OpalIndRegistration:
                    OpalStatusRegistration reg = msg.GetRegistrationStatus();
                    switch (reg.status)
                    {
                    case OpalRegistrationStates.OpalRegisterSuccessful:
                        MessageBox.Show("Registration complete to " + reg.serverName);
                        EnableSafely(Unregister, true);
                        break;

                    case OpalRegistrationStates.OpalRegisterRemoved:
                        MessageBox.Show("Registration removed from " + reg.serverName);
                        EnableSafely(Unregister, false);
                        EnableSafely(Register, true);
                        break;

                    case OpalRegistrationStates.OpalRegisterFailed:
                        MessageBox.Show("Registration failed: " + reg.error);
                        EnableSafely(Register, true);
                        break;
                    }
                    break;

                case OpalMessageType.OpalIndIncomingCall:
                    EnableSafely(Call, false);
                    EnableSafely(Answer, true);
                    EnableSafely(HangUp, true);
                    break;

                case OpalMessageType.OpalIndCallCleared:
                    EnableSafely(Call, true);
                    EnableSafely(Answer, false);
                    EnableSafely(HangUp, false);
                    MessageBox.Show("Call ended: " + msg.GetCallCleared().reason);
                    break;
                }
            }
        }
示例#4
0
 internal static HandleRef getCPtr(OpalStatusRegistration obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
示例#5
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(OpalStatusRegistration obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
示例#6
0
 internal static HandleRef getCPtr(OpalStatusRegistration obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
示例#7
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(OpalStatusRegistration obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }