public ListModelBase <GmsCallQueueCustomerViewModel, OutboundCallQueueFilter> GetGmsCallQueueCustomersReport(int pageNumber, int pageSize, ModelFilterBase filter, out int totalRecords)
        {
            var callQueueFilter = filter as OutboundCallQueueFilter;

            callQueueFilter = callQueueFilter ?? new OutboundCallQueueFilter();
            if (!callQueueFilter.CustomTags.IsNullOrEmpty())
            {
                callQueueFilter.CustomCorporateTag = string.Join(",", callQueueFilter.CustomTags);
            }

            var criteria = _callQueueCriteriaRepository.GetById(callQueueFilter.CriteriaId);


            var collection = new List <GmsCallQueueCustomerViewModel>();

            if (criteria.IsQueueGenerated)
            {
                var callQueue            = _callQueueRepository.GetById(callQueueFilter.CallQueueId);
                var customersInQueueList = _callQueueCustomerRepository.GetMailRoundCustomersForGms(callQueueFilter, pageNumber, pageSize, callQueueFilter.CriteriaId, callQueue, out totalRecords);
                var callqueueCustomers   = customersInQueueList == null ? new List <CallQueueCustomer>() : customersInQueueList.ToList();

                if (!callqueueCustomers.IsNullOrEmpty())
                {
                    var customerIds = callqueueCustomers.Where(x => x.CustomerId.HasValue).Select(x => x.CustomerId.Value).ToArray();
                    var customers   = _customerRepository.GetCustomers(customerIds);

                    var events = _eventReportingService.GetFutureHealthPlanEvents(callQueueFilter.HealthPlanId, DateTime.Today);
                    var hosts  = _hostRepository.GetHostsForFutureHealthPlanEvents(callQueueFilter.HealthPlanId, DateTime.Today);

                    var healthPlan   = ((IUniqueItemRepository <CorporateAccount>)_corporateAccountRepository).GetById(callQueueFilter.HealthPlanId);
                    var organization = _organizationRepository.GetOrganizationbyId(callQueueFilter.HealthPlanId);
                    var customerIdCheckoutNumberPairList = _customerAccountGlocomNumberService.GetGlocomNumberForGmsReport(organization.Id, customers);

                    var setAdditionalField = !string.IsNullOrEmpty(callQueueFilter.CustomCorporateTag);
                    collection = _gmsCallQueueCustomerModelFactory.Create(callqueueCustomers, customers, events, hosts, healthPlan, organization, customerIdCheckoutNumberPairList, setAdditionalField).ToList();
                }
            }
            else
            {
                totalRecords = 0;
            }

            return(new GmsCallQueueCustomerListModel
            {
                Collection = collection
            });
        }