diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/LyncController.cs index c9aaffe0..14b9082b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/LyncController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/LyncController.cs @@ -229,6 +229,34 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } } + if (lync.GetOrganizationTenantId(org.OrganizationId) == string.Empty) + { + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + org.LyncTenantId = lync.CreateOrganization(org.OrganizationId, + org.DefaultDomain, + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ALLOWVIDEO].QuotaAllocatedValue), + Convert.ToInt32(cntx.Quotas[Quotas.LYNC_MAXPARTICIPANTS].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_FEDERATION].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ENTERPRISEVOICE].QuotaAllocatedValue)); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ENABLE_ORG); + return res; + } + else + { + PackageController.UpdatePackageItem(org); + + bReloadConfiguration = true; + } + + + } + + LyncUserPlan plan = GetLyncUserPlan(itemId, lyncUserPlanId); if (!lync.CreateUser(org.OrganizationId, user.UserPrincipalName, plan)) diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs index 8cfb33c3..327e519c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs @@ -38,10 +38,10 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. -// +// using WebsitePanel.Providers.HostedSolution; - + namespace WebsitePanel.Providers.Lync { using System.Xml.Serialization; using System.Web.Services; @@ -88,7 +88,7 @@ namespace WebsitePanel.Providers.Lync { /// public LyncServer() { - this.Url = "http://localhost:9004/LyncServer.asmx"; + this.Url = "http://localhost:9003/LyncServer.asmx"; } /// @@ -193,28 +193,16 @@ namespace WebsitePanel.Providers.Lync { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetOrganizationTenantId", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string GetOrganizationTenantId(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) { + public string GetOrganizationTenantId(string organizationId) { object[] results = this.Invoke("GetOrganizationTenantId", new object[] { - organizationId, - sipDomain, - enableConferencing, - enableConferencingVideo, - maxConferenceSize, - enabledFederation, - enabledEnterpriseVoice}); + organizationId}); return ((string)(results[0])); } /// - public System.IAsyncResult BeginGetOrganizationTenantId(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationTenantId(string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetOrganizationTenantId", new object[] { - organizationId, - sipDomain, - enableConferencing, - enableConferencingVideo, - maxConferenceSize, - enabledFederation, - enabledEnterpriseVoice}, callback, asyncState); + organizationId}, callback, asyncState); } /// @@ -224,23 +212,17 @@ namespace WebsitePanel.Providers.Lync { } /// - public void GetOrganizationTenantIdAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) { - this.GetOrganizationTenantIdAsync(organizationId, sipDomain, enableConferencing, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice, null); + public void GetOrganizationTenantIdAsync(string organizationId) { + this.GetOrganizationTenantIdAsync(organizationId, null); } /// - public void GetOrganizationTenantIdAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, object userState) { + public void GetOrganizationTenantIdAsync(string organizationId, object userState) { if ((this.GetOrganizationTenantIdOperationCompleted == null)) { this.GetOrganizationTenantIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationTenantIdOperationCompleted); } this.InvokeAsync("GetOrganizationTenantId", new object[] { - organizationId, - sipDomain, - enableConferencing, - enableConferencingVideo, - maxConferenceSize, - enabledFederation, - enabledEnterpriseVoice}, this.GetOrganizationTenantIdOperationCompleted, userState); + organizationId}, this.GetOrganizationTenantIdOperationCompleted, userState); } private void OnGetOrganizationTenantIdOperationCompleted(object arg) {