예제 #1
0
        public CallControllerBase(ClientAppViewModel app, HostPhoneViewModel channel, UnitPhoneViewModel unit = null)
            : base(app)
        {
            this.StartTime     = app.Service.GetDateTime();
            this.KeepSelection = false;
            this.DisconnectPOConnectionWhenFinalise = true;
            _connection         = default(T);
            this.Channel        = channel;
            this.Unit           = unit;
            _dialCompletedEvent = new ManualResetEvent(true);
            this.CallStatus     = eCallStatus.Created;

            this.PropertyChanged += OnPropertyChanged;
        }
예제 #2
0
        public ConferenceMember(ConferenceController parent, HostPhoneViewModel channel, byte conferenceId, UnitPhoneViewModel unit = null)
            : base(parent.ClientApp, channel, unit)
        {
            this.StartSpeakingTime       = DateTime.Now;
            this.Parent                  = parent;
            _conStatus                   = eConferenceMemberStatus.Waiting;
            this.ConferenceId            = conferenceId;
            this.Connection.ConferenceId = this.ConferenceId;

            if (this.Unit != null)
            {
                this.Channel.Tone = this.Unit.GetFullNumber();
            }

            Dial();
        }
예제 #3
0
        //string _number = null;

        public CallController(ClientAppViewModel app, HostPhoneViewModel channel, UnitPhoneViewModel unit = null)
            : base(app, channel, unit)
        {
            if (this.Unit != null)
            {
                Dial();
            }
            else
            {
                this.CallStatus = eCallStatus.Connected;
            }

            SendConnection(this.Connection);
            this.Channel.PropertyChanged += Channel_PropertyChanged;
            System.Diagnostics.Debug.WriteLine("Create " + this.ToString());
        }
 public bool IsFreeChannel(HostPhoneViewModel channel)
 {
     lock (this.Controllers)
     {
         if (channel.Status == ePhoneStatus.Free || channel.Status == ePhoneStatus.Selected ||
             channel.LineStatus == eLineStatus.Ring)
         {
             return(this.Controllers.SelectMany(c => c.GetConnections()).SelectMany(c => c.Devices)
                    .All(d => d.Address != channel.HostPhone.Address));
         }
         else
         {
             return(false);
         }
     }
 }
예제 #5
0
        public AlertMember(AlertConferenceController parent, HostPhoneViewModel channel, UnitPhoneViewModel unit)
            : base(parent.ClientApp, channel, unit)
        {
            Parent       = parent;
            _isSelected  = false;
            _alertStatus = AlertMemberStatus.Initialized;

            SoundConnections = new List <KeyValuePair <AlertMemberStatus, SwitchConnection> >()
            {
                new KeyValuePair <AlertMemberStatus, SwitchConnection>(AlertMemberStatus.WaitForKeycode,
                                                                       new SwitchConnection(ClientApp.ClientId, new SwitchConnectionEnd(OtherDevice.SoundChannels[1]), new SwitchConnectionEnd(Channel.HostPhone))),

                new KeyValuePair <AlertMemberStatus, SwitchConnection>(AlertMemberStatus.WaitForCommand,
                                                                       new SwitchConnection(ClientApp.ClientId, new SwitchConnectionEnd(OtherDevice.SoundChannels[2]), new SwitchConnectionEnd(Channel.HostPhone))),

                new KeyValuePair <AlertMemberStatus, SwitchConnection>(AlertMemberStatus.WaitForReport,
                                                                       new SwitchConnection(ClientApp.ClientId, new SwitchConnectionEnd(OtherDevice.SoundChannels[3]), new SwitchConnectionEnd(Channel.HostPhone)))
            };

            Dial();
        }
예제 #6
0
 public InCallController(ClientAppViewModel app, HostPhoneViewModel channel, UnitPhoneViewModel unit = null)
     : base(app, channel, unit)
 {
     this.ClientApp.Service.Request(eResourceType.Channel, this.Channel.Id);
 }
예제 #7
0
 public bool IsChannelUsable(HostPhoneViewModel c)
 {
     return((this.WorkingMode == eWorkingMode.Alert && c.HostPhone.AlertEnabled) ||
            (this.WorkingMode == eWorkingMode.MultiDest && c.HostPhone.MultiDestEnabled) ||
            (this.WorkingMode == eWorkingMode.CCPK_Alert && c.HostPhone.CCPKEnabled));
 }
예제 #8
0
 public ConferenceMemberBase(ClientAppViewModel app, HostPhoneViewModel channel, UnitPhoneViewModel unit = null)
     : base(app, channel, unit)
 {
 }
 public IController GetController(HostPhoneViewModel channel)
 {
     return(Controllers.FirstOrDefault(c =>
                                       c.GetConnections().SelectMany(cc => cc.Devices).Any(d => d.Address == channel.HostPhone.Address)));
 }