Пример #1
0
        void _avaya_MessageReceived(object sender, MessageReceivedEventArgs e)
        {
            UIAction(() => Messages.Insert(0,e.Message));

              switch (e.Message.Type)
              {
            case Message.MessageType.Command:
              break;
            case Message.MessageType.Pending:
              break;
            case Message.MessageType.Data:
              break;
            case Message.MessageType.Response:
              switch (e.Message.Command.Trim())
              {
            case "AGTLogon":
              //Avaya.ReserveHeadset("1");
              break;
            case "AGTReserveHeadset":
              //Avaya.ConnectHeadset();
              break;
            case "AGTConnHeadset":
              //Avaya.ListState();
              break;
            //case "AGTListState":
            //  Avaya.DisconnectHeadset();
            //  break;
            //case "AGTDisconnHeadset":
            //  Avaya.SendCommand(new Message("AGTFreeHeadset", Message.MessageType.Command));
            //  break;
            //case "AGTFreeHeadset":
            //  Avaya.Logoff();
            //  break;
            //case "AGTLogoff":
            //  Avaya.Disconnect();
            //  break;
               }

              break;
            case Message.MessageType.Busy:
              break;
            case Message.MessageType.Notification:
              switch (e.Message.Command.Trim())
              {
            case "AGTSTART":
              //Avaya.Login("m9057","mlitt001");
              break;
              }
              break;
            case Message.MessageType.Undefined:
              break;
            default:
              throw new ArgumentOutOfRangeException();
              }
        }
Пример #2
0
 private void _client_MessageReceived(object sender, MessageReceivedEventArgs e)
 {
     if (MessageReceived != null)
     MessageReceived(this, e);
 }