Exemple #1
0
        private object LedMessageProcessing(CdmMessage mcc)
        {
            richTextBoxLog.AppendText(Environment.NewLine + JsonConvert.SerializeObject(mcc));
            try
            {
                var voice = string.Empty;
                switch (mcc.LedMsgType)
                {
                case LedMsgType.Processing:
                    voice = textBoxprocessing.Text.Replace("queueNum", mcc.Content);
                    break;

                case LedMsgType.Done:
                    voice = textBoxdone.Text.Replace("queueNum", mcc.Content);
                    break;

                default:
                    voice = textBoxreject.Text.Replace("queueNum", mcc.Content);
                    break;
                }

                MsmqMsgSend(voice);
                richTextBoxLog.AppendText(Environment.NewLine + voice);
            }
            catch (Exception ex)
            {
                richTextBoxLog.AppendText(Environment.NewLine + ex.Message);
            }
            return(string.Empty);
        }
Exemple #2
0
        private object VoiceMessageProcessing(CdmMessage mcc)
        {
            richTextBox1.AppendText(Environment.NewLine + JsonConvert.SerializeObject(mcc));
            try
            {
                Type type = Type.GetTypeFromProgID("SAPI.SpVoice");

                dynamic spVoice = Activator.CreateInstance(type);
                string  voice;
                switch (mcc.VoiceType)
                {
                case VoiceType.Fee:
                    voice = textBoxfeevoice.Text.Replace("queueNum", mcc.Content);
                    break;

                default:
                    voice = textBoxreject.Text.Replace("queueNum", mcc.Content);
                    break;
                }

                spVoice.Speak(voice);
                richTextBox1.AppendText(Environment.NewLine + voice);
                Thread.Sleep(1000 * 60 * 2);
                spVoice.Speak(voice);
            }
            catch (Exception ex)
            {
                richTextBox1.AppendText(Environment.NewLine + ex.Message);
            }
            return(string.Empty);
        }
Exemple #3
0
 public async static Task <int> PushLedMessage(CdmMessage mt)
 {
     if (Connection.State.Equals(Microsoft.AspNet.SignalR.Client.ConnectionState.Disconnected))
     {
         try
         {
             await Connection.Start();
         }
         catch (HttpRequestException hex)
         {
             Log.Error("pushledmsg.HttpRequestException" + hex.Message);
             return(-1);
         }
         catch (Exception ex)
         {
             Log.Error("pushledmsg." + ex.Message);
             return(-2);
         }
     }
     try
     {
         await HubProxy.Invoke("LedMessage", mt);
     }
     catch (Exception ex)
     {
         Log.Error("HubProxy.Invoke(PushLedMsg, mt);." + ex.Message);
         return(-3);
     }
     return(0);
 }
Exemple #4
0
 public void Message(CdmMessage message)
 {
     Log.Info("11");
     Log.InfoFormat("cdm hub message invoke by {0},{1}", Context.ConnectionId, "");
     Log.Info("22");
     Clients.Caller.Message(message);
     Log.Info("33");
 }
Exemple #5
0
        private object VoiceMessageProcessing(CdmMessage mcc)
        {
            BeginInvoke(new UpdateStatusDelegate(UpdateStatus), new object[] { string.Format("voice message received:{0}", JsonConvert.SerializeObject(mcc)) });
            var t = new Thread(new ParameterizedThreadStart(VoiceBroadcast));

            t.Start(mcc);

            return(string.Empty);
        }
Exemple #6
0
 public void LedMessage(CdmMessage message)
 {
     //   Log.InfoFormat("cdm hub VoiceMessage invoke by {0},{1}", Context.ConnectionId, JsonConvert.SerializeObject(message));
     Log.Info("all logined clients:" + JsonConvert.SerializeObject(CdmClients));
     foreach (CdmClient cdmClient in CdmClients)
     {
         if (message.CountyCode == cdmClient.CountyCode && message.ClientType == cdmClient.ClientType)
         {
             Clients.Client(cdmClient.ConnectId).LedMessage(message);
             return;
         }
     }
     Log.InfoFormat("LedMessage:{0} can't find logined client,discarded.", JsonConvert.SerializeObject(message));
 }
Exemple #7
0
        private static object VoiceMessageProcessing(CdmMessage mcc)
        {
            TraceLog(string.Format("voice message received:{0}", JsonConvert.SerializeObject(mcc)));
            try
            {
                //  TraceLog(string.Format("VoiceMessageProcessing error:{0}", 111));
                var t = new Thread(new ParameterizedThreadStart(VoiceBroadcast));
                //   TraceLog(string.Format("VoiceMessageProcessing error:{0}", 222));
                t.Start(mcc);
                //  TraceLog(string.Format("VoiceMessageProcessing error:{0}", 333));
            }
            catch (Exception ex)
            {
                TraceLog(string.Format("VoiceMessageProcessing error:{0}", ex));
            }

            return(string.Empty);
        }
Exemple #8
0
 private object NewMessageProcessing(CdmMessage mcc)
 {
     richTextBox1.AppendText(Environment.NewLine + JsonConvert.SerializeObject(mcc));
     return(string.Empty);
 }