예제 #1
0
        public ConferenceMember(ConferenceController parent, InCallController call, eConferenceMemberStatus conStatus, byte conferenceId) : base(call.ClientApp, call.Channel, call.Unit)
        {
            this.Parent = parent;
            call.DisconnectPOConnectionWhenFinalise = false;
            call.KeepSelection = true;
            call.Finalise();

            this.ConferenceId            = conferenceId;
            this.Connection.ConferenceId = this.ConferenceId;

            SendConnection(this.Connection);
            this.ConStatus = conStatus;
        }
예제 #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();
        }
        public void OnCallGroup()
        {
            this.ClientApp.AddLog("Gọi nhóm");
            lock (this.Controllers)
            {
                var ctrl = this.Controllers.OfType <ConferenceController>().FirstOrDefault();
                if (ctrl != null)
                {
                    if (ctrl.IsHolding)
                    {
                        ctrl.Resume();

                        // Tim cac cuoc goi don, dua vao hoi nghi
                        var calls = this.Controllers.OfType <InCallController>().ToList();
                        if (calls.Count > 0)
                        {
                            foreach (var c in calls)
                            {
                                var conStatus = eConferenceMemberStatus.Listening;
                                if (ctrl.GetSpeakerCount() < ConferenceControllerBase <ConferenceMember> .MaxSpeaker)
                                {
                                    conStatus = eConferenceMemberStatus.Speaking;
                                }
                                ctrl.Controllers.Add(new ConferenceMember(ctrl, c, conStatus, this.ClientApp.ClientId));
                            }
                        }
                    }
                    else
                    {
                        ctrl.Finalise();
                    }
                }
                else
                {
                    var units = this.ClientApp.GetSelectedUnits(u => IsFreeUnit(u));
                    if (units.Any())
                    {
                        ctrl = new ConferenceController(this.ClientApp, units);
                        this.Controllers.Add(ctrl);
                        this.ActiveController = ctrl;
                    }

                    var calls = this.Controllers.OfType <InCallController>().ToList();

                    if (calls.Any())
                    {
                        if (ctrl == null)
                        {
                            ctrl = new ConferenceController(this.ClientApp, null);
                        }

                        foreach (var c in calls)
                        {
                            ctrl.Controllers.Add(new ConferenceMember(ctrl, c, eConferenceMemberStatus.Waiting, this.ClientApp.ClientId));
                        }
                    }

                    if (ctrl != null)
                    {
                        this.Controllers.Add(ctrl);
                        this.ActiveController = ctrl;
                        ctrl.InitMemberVolumn();
                    }
                }

                if (ctrl != null && ctrl.FinalisedDate == null)
                {
                    this.ActiveController = ctrl;
                }

                OnPropertyChanged("HasConference");
                OnPropertyChanged("IsRecording");
                ReleaseAllFreeUnits();
            }
        }