示例#1
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;
                }
            }
        }
示例#2
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;
                }
            }
        }
示例#3
0
文件: Form1.cs 项目: cnc123/opal
        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
        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;
                }
            }
        }