private CallButlerDataset.ProvidersRow CreateProviderRow(CallButler.Manager.Plugin.ProviderData providerData, string pluginID) { CallButlerDataset.ProvidersRow provider = callButlerDataset.Providers.NewProvidersRow(); if (DefaultCount == 0) { provider.IsDefault = true; } provider.CustomerID = Properties.Settings.Default.CustomerID; provider.ProviderID = Guid.NewGuid(); provider.PluginID = pluginID; if (providerData.AuthPassword != null && providerData.AuthPassword.Length > 0) { provider.AuthPassword = WOSI.Utilities.CryptoUtils.Encrypt(providerData.AuthPassword, WOSI.CallButler.Data.Constants.EncryptionPassword); } provider.AuthUsername = providerData.AuthUsername; provider.DisplayName = providerData.DisplayName; provider.Domain = providerData.Domain; provider.EnableRegistration = providerData.EnableRegistration; provider.Expires = providerData.Expires; provider.IsEnabled = providerData.IsEnabled; provider.ExtraData = providerData.ExtraData; provider.Name = providerData.Name; provider.SIPProxy = providerData.SIPProxy; provider.SIPRegistrar = providerData.SIPRegistrar; provider.Username = providerData.Username; return(provider); }
private void DeleteProvider(CallButlerDataset.ProvidersRow provider) { Guid providerID = provider.ProviderID; callButlerDataset.Providers.RemoveProvidersRow(provider); ManagementInterfaceClient.ManagementInterface.DeleteProvider(ManagementInterfaceClient.AuthInfo, providerID); }
internal DialogResult AddNewProvider(ProviderType type, bool showInitialDialog) { DialogResult res = DialogResult.Cancel; CallButler.Manager.Plugin.CallButlerManagementProviderPlugin providerPlugin = null; /*if (showInitialDialog) * { * InitialProviderDialog dlg = new InitialProviderDialog(); * if (dlg.ShowDialog(this) == DialogResult.OK) * { * type = dlg.ProviderType; * } * }*/ /*switch (type) * { * case ProviderType.CallButler: * // Get our default CallButler provider plugin * providerPlugin = (CallButler.Manager.Plugin.CallButlerManagementProviderPlugin)PluginManager.GetPluginFromID(new Guid(Properties.Settings.Default.PreferredVoIPProviderPluginID)); * break;*/ //case ProviderType.Other: providerPlugin = (CallButler.Manager.Plugin.CallButlerManagementProviderPlugin)PluginManager.GetPluginFromID(new Guid(Properties.Settings.Default.DefaultVoIPProviderPluginID)); //break; //} if (providerPlugin != null) { CallButler.Manager.Plugin.ProviderData providerData = providerPlugin.AddNewProvider(); if (providerData != null) { CallButlerDataset.ProvidersRow provider = CreateProviderRow(providerData, providerPlugin.ServicePluginID.ToString()); callButlerDataset.Providers.AddProvidersRow(provider); SaveProviderRow(provider); res = DialogResult.OK; } } return(res); }
public override bool PersistProvider(CallButlerDataset.ProvidersRow provider) { bool added = false; CallButler.Data.CallButlerDataset.ProvidersRow existingRow = data.Providers.FindByProviderID(provider.ProviderID); // If the row doesn't exist, add it. Otherwise edit it if (existingRow == null) { // Add a new row data.Providers.ImportRow(provider); added = true; } else { // Update the row UpdateRowChanges(existingRow, provider); } SaveChanges(); return(added); }
private void SaveProviderRow(CallButlerDataset.ProvidersRow row) { CallButlerDataset.ProvidersDataTable providerDataTable = Utils.TableUtils <CallButlerDataset.ProvidersDataTable> .CreateTableFromRow(row); ManagementInterfaceClient.ManagementInterface.PersistProviders(ManagementInterfaceClient.AuthInfo, providerDataTable); }
private void EditProvider(CallButlerDataset.ProvidersRow provider) { // Get the provider editor plugin CallButler.Manager.Plugin.CallButlerManagementProviderPlugin providerPlugin = (CallButler.Manager.Plugin.CallButlerManagementProviderPlugin)PluginManager.GetPluginFromID(new Guid(Properties.Settings.Default.DefaultVoIPProviderPluginID)); /*try * { * // Check to see if this provider uses a different plugin * if(provider.PluginID != null && provider.PluginID.Length > 0) * providerPlugin = (CallButler.Manager.Plugin.CallButlerManagementProviderPlugin)PluginManager.GetPluginFromID(new Guid(provider.PluginID)); * } * catch * { * }*/ if (providerPlugin != null) { // Copy our provider row into our provider data CallButler.Manager.Plugin.ProviderData providerData = new CallButler.Manager.Plugin.ProviderData(); if (provider.AuthPassword != null && provider.AuthPassword.Length > 0) { providerData.AuthPassword = WOSI.Utilities.CryptoUtils.Decrypt(provider.AuthPassword, WOSI.CallButler.Data.Constants.EncryptionPassword); } providerData.AuthUsername = provider.AuthUsername; providerData.DisplayName = provider.DisplayName; providerData.Domain = provider.Domain; providerData.EnableRegistration = provider.EnableRegistration; providerData.Expires = provider.Expires; providerData.ExtraData = provider.ExtraData; providerData.IsEnabled = provider.IsEnabled; providerData.Name = provider.Name; providerData.SIPProxy = provider.SIPProxy; providerData.SIPRegistrar = provider.SIPRegistrar; providerData.Username = provider.Username; // Edit the data providerData = providerPlugin.EditProvider(providerData); if (providerData != null) { // Copy the data back into our provider row if (providerData.AuthPassword != null && providerData.AuthPassword.Length > 0) { provider.AuthPassword = WOSI.Utilities.CryptoUtils.Encrypt(providerData.AuthPassword, WOSI.CallButler.Data.Constants.EncryptionPassword); } provider.AuthUsername = providerData.AuthUsername; provider.DisplayName = providerData.DisplayName; provider.Domain = providerData.Domain; provider.EnableRegistration = providerData.EnableRegistration; provider.Expires = providerData.Expires; provider.ExtraData = providerData.ExtraData; provider.IsEnabled = providerData.IsEnabled; provider.Name = providerData.Name; provider.SIPProxy = providerData.SIPProxy; provider.SIPRegistrar = providerData.SIPRegistrar; provider.Username = providerData.Username; SaveProviderRow(provider); LoadData(); } } }
public abstract bool PersistProvider(CallButlerDataset.ProvidersRow provider);