Exemplo n.º 1
0
        private void Initialize(string key, TesiraDialerControlBlockConfig config)
        {
            if (config.Enabled)
            {
                DeviceManager.AddDevice(this);
            }

            Debug.Console(2, this, "Adding Dialer '{0}'", Key);

            IsSubscribed           = false;
            PotsIsSubscribed       = false;
            VoipIsSubscribed       = false;
            AutoAnswerIsSubscribed = false;

            Label          = config.Label;
            IsVoip         = config.IsVoip;
            LineNumber     = config.Index;
            AppendDtmf     = config.AppendDtmf;
            ClearOnHangup  = config.ClearOnHangup;
            Enabled        = config.Enabled;
            CallAppearance = config.CallAppearance;
            DisplayNumber  = config.DisplayNumber;

            ActiveCalls = new List <CodecActiveCallItem>();
            var activeCall = new CodecActiveCallItem();

            activeCall.Name      = "";
            activeCall.Number    = "";
            activeCall.Type      = eCodecCallType.Audio;
            activeCall.Status    = eCodecCallStatus.Idle;
            activeCall.Direction = eCodecCallDirection.Unknown;
            activeCall.Id        = Key;

            ActiveCalls.Add(activeCall);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor for Tesira DSP Dialer
        /// </summary>
        /// <param name="key">Unique Key</param>
        /// <param name="config">Component Config</param>
        /// <param name="parent">Parent Device</param>
        public TesiraDspDialer(string key, TesiraDialerControlBlockConfig config, TesiraDsp parent)
            : base(key, config.DialerInstanceTag, config.ControlStatusInstanceTag, config.Index, config.CallAppearance, parent, config.BridgeIndex)
        {
            Key = string.Format("{0}--Dialer{1}", parent.Key, key);

            Feedbacks = new FeedbackCollection <Feedback>();

            DialStringFeedback     = new StringFeedback(Key + "-DialStringFeedback", () => DialString);
            OffHookFeedback        = new BoolFeedback(Key + "-OffHookFeedback", () => OffHookStatus);
            AutoAnswerFeedback     = new BoolFeedback(Key + "-AutoAnswerFeedback", () => AutoAnswerState);
            DoNotDisturbFeedback   = new BoolFeedback(Key + "-DoNotDisturbFeedback", () => DoNotDisturbState);
            CallerIdNumberFeedback = new StringFeedback(Key + "-CallerIDNumberFeedback", () => CallerIdNumber);
            CallerIdNameFeedback   = new StringFeedback(Key + "-CallerIDNameFeedback", () => CallerIdName);
            IncomingCallFeedback   = new BoolFeedback(Key + "-IncomingCallFeedback", () => IncomingCallState);
            CallStateFeedback      = new IntFeedback(Key + "-CallStateFeedback", () => (int)CallStatusEnum);
            LastDialedFeedback     = new StringFeedback(Key + "-LastDialedFeedback", () => LastDialed);
            NameFeedback           = new StringFeedback(Key + "-NameFeedback", () => Name);
            DisplayNumberFeedback  = new StringFeedback(Key + "-DisplayNumberFeedback", () => DisplayNumber);

            Feedbacks.Add(DialStringFeedback);
            Feedbacks.Add(OffHookFeedback);
            Feedbacks.Add(AutoAnswerFeedback);
            Feedbacks.Add(DoNotDisturbFeedback);
            Feedbacks.Add(CallerIdNumberFeedback);
            Feedbacks.Add(CallerIdNameFeedback);
            Feedbacks.Add(IncomingCallFeedback);
            Feedbacks.Add(CallStateFeedback);
            Feedbacks.Add(LastDialedFeedback);
            Feedbacks.Add(NameFeedback);
            Feedbacks.Add(DisplayNumberFeedback);

            parent.Feedbacks.AddRange(Feedbacks);

            Initialize(key, config);
        }