From b7ea91011a6509e1d293fd39f4fc936213d48e6f Mon Sep 17 00:00:00 2001 From: Nick Genovese Date: Wed, 25 Aug 2021 19:30:37 -0700 Subject: [PATCH] fix: added ability to direct dial a string --- QscQsysDspPlugin/QscDspBridge.cs | 1 + QscQsysDspPlugin/QscDspDialer.cs | 71 +++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/QscQsysDspPlugin/QscDspBridge.cs b/QscQsysDspPlugin/QscDspBridge.cs index 98ae23d..68faed8 100644 --- a/QscQsysDspPlugin/QscDspBridge.cs +++ b/QscQsysDspPlugin/QscDspBridge.cs @@ -104,6 +104,7 @@ public static void LinkToApiExt(this QscDsp DspDevice, BasicTriList trilist, uin trilist.SetSigTrueAction((joinMap.KeypadBackspace + dialerLineOffset), () => dialer.Value.SendKeypad(QscDspDialer.EKeypadKeys.Backspace)); // from SiMPL > to Plugin trilist.SetSigTrueAction(joinMap.Dial + dialerLineOffset, () => dialer.Value.Dial()); + trilist.SetStringSigAction(joinMap.DialStringCmd + dialerLineOffset, dialer.Value.Dial); trilist.SetSigTrueAction(joinMap.DoNotDisturbToggle + dialerLineOffset, () => dialer.Value.DoNotDisturbToggle()); trilist.SetSigTrueAction(joinMap.DoNotDisturbOn + dialerLineOffset, () => dialer.Value.DoNotDisturbOn()); trilist.SetSigTrueAction(joinMap.DoNotDisturbOff + dialerLineOffset, () => dialer.Value.DoNotDisturbOff()); diff --git a/QscQsysDspPlugin/QscDspDialer.cs b/QscQsysDspPlugin/QscDspDialer.cs index 99c5410..289e4c5 100644 --- a/QscQsysDspPlugin/QscDspDialer.cs +++ b/QscQsysDspPlugin/QscDspDialer.cs @@ -345,7 +345,76 @@ public void Dial() /// Number to dial public void Dial(string number) { - throw new NotImplementedException(); + if (string.IsNullOrEmpty(number)) + return; + + SendKeypad(EKeypadKeys.Clear); + foreach (var digit in number) + { + switch (digit) + { + case '0': + { + SendKeypad(EKeypadKeys.Num0); + break; + } + case '1': + { + SendKeypad(EKeypadKeys.Num1); + break; + } + case '2': + { + SendKeypad(EKeypadKeys.Num2); + break; + } + case '3': + { + SendKeypad(EKeypadKeys.Num3); + break; + } + case '4': + { + SendKeypad(EKeypadKeys.Num4); + break; + } + case '5': + { + SendKeypad(EKeypadKeys.Num5); + break; + } + case '6': + { + SendKeypad(EKeypadKeys.Num6); + break; + } + case '7': + { + SendKeypad(EKeypadKeys.Num7); + break; + } + case '8': + { + SendKeypad(EKeypadKeys.Num8); + break; + } + case '9': + { + SendKeypad(EKeypadKeys.Num9); + break; + } + case '#': + { + SendKeypad(EKeypadKeys.Pound); + break; + } + case '*': + { + SendKeypad(EKeypadKeys.Star); + break; + } + } + } } ///