Example #1
0
 private void ActivateVoIPLine(bool activate)
 {
     if (m_spokes.DeviceCapabilities.HasMultiline)
     {
         m_spokes.SetLineActive(Multiline_LineType.PC, activate);
     }
     else
     {
         m_spokes.ConnectAudioLinkToDevice(activate);
     }
 }
Example #2
0
        private static void Parsecommand(string rcv)
        {
            // tokenize command...
            string[] tokens = new string[10];
            for (int i = 0; i < 10; i++)
            {
                tokens[i] = "";
            }
            string[] words  = rcv.Split(',');
            int      curtok = 0;

            foreach (string word in words)
            {
                tokens[curtok] = word;
                curtok++;
            }

            Console.WriteLine("Parsecommand: " + tokens[0]);

            if (tokens[0].Length > 0)
            {
                switch (tokens[0].ToLower())
                {
                case "ansmob":
                    spokes.AnswerMobileCall();
                    break;

                case "audioon":
                    spokes.ConnectAudioLinkToDevice(Convert.ToBoolean(tokens[1]));
                    break;

                case "audiooff":
                    spokes.ConnectAudioLinkToDevice(Convert.ToBoolean(tokens[1]));
                    break;

                case "dialmob":
                    spokes.DialMobileCall(tokens[1]);
                    break;

                case "endcall":
                    spokes.EndCall(Convert.ToInt32(tokens[1]));
                    break;

                case "endmobcall":
                    break;

                case "incoming":
                    // incoming call (ring headset)
                    spokes.IncomingCall(Convert.ToInt32(tokens[1]), tokens[2]);
                    break;

                case "muteon":
                    spokes.SetMute(Convert.ToBoolean(tokens[1]));
                    break;

                case "muteoff":
                    spokes.SetMute(Convert.ToBoolean(tokens[1]));
                    break;

                case "outgoing":
                    // outgoing call
                    spokes.OutgoingCall(Convert.ToInt32(tokens[1]), tokens[2]);
                    break;

                case "reqserial":
                    int serialtype = Convert.ToInt32(tokens[1]);
                    spokes.RequestSingleSerialNumber(serialtype == 1 ? SerialNumberTypes.Base : SerialNumberTypes.Headset);
                    break;

                case "setlineactive":
                    spokes.SetLineActive((Multiline_LineType)(Convert.ToInt32(tokens[1]) - 1),
                                         Convert.ToInt32(tokens[2]) == 1 ? true : false);
                    break;

                case "setlinehold":
                    spokes.SetLineHold((Multiline_LineType)(Convert.ToInt32(tokens[1]) - 1),
                                       Convert.ToInt32(tokens[2]) == 1 ? true : false);
                    break;

                default:
                    Console.WriteLine("WARNING: Command not recognised.");
                    break;
                }
            }


            // parse incoming command
            if (rcv.ToLower().StartsWith("incoming"))
            {
                // ring headset
                spokes.IncomingCall(1, "Lew");
            }
        }