protected void ValidateCommonParamsAndSetOrg(UMDialPlanIdParameter dpParam, UMIPGatewayIdParameter gwParam, out Guid dpGuid, out Guid gwGuid, out string dpName, out string gwName)
        {
            dpGuid = Guid.Empty;
            gwGuid = Guid.Empty;
            dpName = string.Empty;
            gwName = string.Empty;
            if (dpParam == null && gwParam == null)
            {
                return;
            }
            IConfigurationSession session        = this.CreateSessionToResolveConfigObjects(false);
            OrganizationId        organizationId = null;

            if (dpParam != null)
            {
                UMDialPlan umdialPlan = (UMDialPlan)base.GetDataObject <UMDialPlan>(dpParam, session, null, new LocalizedString?(Strings.NonExistantDialPlan(dpParam.ToString())), new LocalizedString?(Strings.MultipleDialplansWithSameId(dpParam.ToString())));
                dpGuid         = umdialPlan.Guid;
                dpName         = umdialPlan.Name;
                organizationId = umdialPlan.OrganizationId;
            }
            if (gwParam != null)
            {
                UMIPGateway umipgateway = (UMIPGateway)base.GetDataObject <UMIPGateway>(gwParam, session, null, new LocalizedString?(Strings.NonExistantIPGateway(gwParam.ToString())), new LocalizedString?(Strings.MultipleIPGatewaysWithSameId(gwParam.ToString())));
                gwGuid = umipgateway.Guid;
                gwName = umipgateway.Name;
                if (organizationId != null && !organizationId.Equals(umipgateway.OrganizationId))
                {
                    base.WriteError(new InvalidParameterException(Strings.MismatchedOrgInDPAndGW(dpParam.ToString(), gwParam.ToString())), ErrorCategory.InvalidArgument, null);
                }
                else
                {
                    organizationId = umipgateway.OrganizationId;
                }
            }
            if (this.Organization != null)
            {
                organizationId != null;
            }
            if (organizationId != null)
            {
                base.CurrentOrganizationId = organizationId;
            }
        }
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            UMAutoAttendant umautoAttendant = (UMAutoAttendant)base.PrepareDataObject();

            umautoAttendant.SetId((IConfigurationSession)base.DataSession, base.Name);
            UMDialPlanIdParameter umdialPlan  = this.UMDialPlan;
            UMDialPlan            umdialPlan2 = (UMDialPlan)base.GetDataObject <UMDialPlan>(umdialPlan, this.GetDialPlanSession(), null, new LocalizedString?(Strings.NonExistantDialPlan(umdialPlan.ToString())), new LocalizedString?(Strings.MultipleDialplansWithSameId(umdialPlan.ToString())));

            umautoAttendant.SetDialPlan(umdialPlan2.Id);
            this.dialPlan = umdialPlan2;
            if (base.HasErrors)
            {
                return(null);
            }
            if (base.Fields.IsModified("DTMFFallbackAutoAttendant"))
            {
                UMAutoAttendantIdParameter dtmffallbackAutoAttendant = this.DTMFFallbackAutoAttendant;
                if (dtmffallbackAutoAttendant != null)
                {
                    this.fallbackAA = (UMAutoAttendant)base.GetDataObject <UMAutoAttendant>(dtmffallbackAutoAttendant, base.DataSession, null, new LocalizedString?(Strings.NonExistantAutoAttendant(dtmffallbackAutoAttendant.ToString())), new LocalizedString?(Strings.MultipleAutoAttendantsWithSameId(dtmffallbackAutoAttendant.ToString())));
                    umautoAttendant.DTMFFallbackAutoAttendant = this.fallbackAA.Id;
                }
                else
                {
                    umautoAttendant.DTMFFallbackAutoAttendant = null;
                }
            }
            TaskLogger.LogExit();
            return(umautoAttendant);
        }
Beispiel #3
0
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            UMMailboxPolicy ummailboxPolicy = (UMMailboxPolicy)base.PrepareDataObject();

            if (!base.HasErrors)
            {
                UMDialPlanIdParameter umdialPlan      = this.UMDialPlan;
                IConfigurationSession dialPlanSession = this.GetDialPlanSession();
                UMDialPlan            umdialPlan2     = (UMDialPlan)base.GetDataObject <UMDialPlan>(umdialPlan, dialPlanSession, null, new LocalizedString?(Strings.NonExistantDialPlan(umdialPlan.ToString())), new LocalizedString?(Strings.MultipleDialplansWithSameId(umdialPlan.ToString())));
                ummailboxPolicy.UMDialPlan = umdialPlan2.Id;
                ummailboxPolicy.SourceForestPolicyNames.Add(ummailboxPolicy.Name);
            }
            return(ummailboxPolicy);
        }
Beispiel #4
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            base.CreateParentContainerIfNeeded(this.DataObject);
            UMDialPlanIdParameter umdialPlan      = this.UMDialPlan;
            IConfigurationSession dialPlanSession = this.GetDialPlanSession();
            UMDialPlan            umdialPlan2     = (UMDialPlan)base.GetDataObject <UMDialPlan>(umdialPlan, dialPlanSession, null, new LocalizedString?(Strings.NonExistantDialPlan(umdialPlan.ToString())), new LocalizedString?(Strings.MultipleDialplansWithSameId(umdialPlan.ToString())));

            if (umdialPlan2.SubscriberType == UMSubscriberType.Consumer)
            {
                this.DataObject.AllowDialPlanSubscribers = false;
                this.DataObject.AllowExtensions          = false;
            }
            base.InternalProcessRecord();
            TaskLogger.LogExit();
        }
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            UMHuntGroup           umhuntGroup = (UMHuntGroup)base.PrepareDataObject();
            IConfigurationSession session     = (IConfigurationSession)base.DataSession;
            UMDialPlanIdParameter umdialPlan  = this.UMDialPlan;
            UMDialPlan            umdialPlan2 = (UMDialPlan)base.GetDataObject <UMDialPlan>(umdialPlan, session, this.RootId, new LocalizedString?(Strings.NonExistantDialPlan(umdialPlan.ToString())), new LocalizedString?(Strings.MultipleDialplansWithSameId(umdialPlan.ToString())));

            umhuntGroup.UMDialPlan = umdialPlan2.Id;
            if (umdialPlan2.URIType == UMUriType.SipName && !VariantConfiguration.InvariantNoFlightingSnapshot.UM.HuntGroupCreationForSipDialplans.Enabled)
            {
                base.WriteError(new CannotCreateHuntGroupForHostedSipDialPlanException(), ErrorCategory.InvalidOperation, umhuntGroup);
            }
            UMIPGatewayIdParameter umipgateway  = this.UMIPGateway;
            UMIPGateway            umipgateway2 = (UMIPGateway)base.GetDataObject <UMIPGateway>(umipgateway, session, this.RootId, new LocalizedString?(Strings.NonExistantIPGateway(umipgateway.ToString())), new LocalizedString?(Strings.MultipleIPGatewaysWithSameId(umipgateway.ToString())));
            bool flag = false;

            foreach (UMHuntGroup umhuntGroup2 in umipgateway2.HuntGroups)
            {
                if (umhuntGroup2.PilotIdentifier == umhuntGroup.PilotIdentifier)
                {
                    flag = true;
                    break;
                }
            }
            if (flag)
            {
                HuntGroupAlreadyExistsException exception = new HuntGroupAlreadyExistsException(umipgateway2.Name, umhuntGroup.PilotIdentifier);
                base.WriteError(exception, ErrorCategory.InvalidArgument, null);
            }
            else
            {
                umhuntGroup.SetId(umipgateway2.Id.GetChildId(base.Name));
            }
            TaskLogger.LogExit();
            return(umhuntGroup);
        }