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); }
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); }
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); }
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"); }
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); }
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)); }
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); }
private object NewMessageProcessing(CdmMessage mcc) { richTextBox1.AppendText(Environment.NewLine + JsonConvert.SerializeObject(mcc)); return(string.Empty); }