Skip to content

Commit

Permalink
fix: added ability to direct dial a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ngenovese11 committed Aug 26, 2021
1 parent 0692139 commit b7ea910
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
1 change: 1 addition & 0 deletions QscQsysDspPlugin/QscDspBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
71 changes: 70 additions & 1 deletion QscQsysDspPlugin/QscDspDialer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,76 @@ public void Dial()
/// <param name="number">Number to dial</param>
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;
}
}
}
}

/// <summary>
Expand Down

0 comments on commit b7ea910

Please sign in to comment.