- Joined
- Oct 14, 2015
- Messages
- 1
- Reaction score
- 0
Hi there,
I use the 3cxpscomcpp2.dll-assembly in a .NET 4.0 Windows Service to monitor incoming phone calls and protocol them in a SQL database. After installing the latest version (V14), the service throws the following exception: Config server is not connected. I saw that a new 3cxpscomcpp2.dll was delivered and I recompiled the project with the new assembly but the application still crashes.
I use the following code from your example:
Many thanks in advance for your help!
I use the 3cxpscomcpp2.dll-assembly in a .NET 4.0 Windows Service to monitor incoming phone calls and protocol them in a SQL database. After installing the latest version (V14), the service throws the following exception: Config server is not connected. I saw that a new 3cxpscomcpp2.dll was delivered and I recompiled the project with the new assembly but the application still crashes.
I use the following code from your example:
Code:
try
{
#region phone system initialization(init db server)
PhoneSystem.ApplicationName = "SE.3CX";
RegistryKey regKeyAppRoot;
if (IntPtr.Size == 4)
{
regKeyAppRoot = Registry.LocalMachine.OpenSubKey("SOFTWARE\\3CX\\PhoneSystem");
}
else
{
regKeyAppRoot = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\3CX\\PhoneSystem");
}
String _appPath = (string)regKeyAppRoot.GetValue("AppPath");
String filePath = Path.Combine(_appPath, @"Bin\3CXPhoneSystem.ini");
String value = GetKeyValue("ConfService", "ConfPort", filePath);
Int32 port = 0;
if (!String.IsNullOrEmpty(value))
{
Int32.TryParse(value.Trim(), out port);
PhoneSystem.CfgServerPort = port;
}
value = GetKeyValue("ConfService", "confUser", filePath);
if (!String.IsNullOrEmpty(value))
PhoneSystem.CfgServerUser = value;
value = GetKeyValue("ConfService", "confPass", filePath);
if (!String.IsNullOrEmpty(value))
PhoneSystem.CfgServerPassword = value;
#endregion
Tenant[] tenantArr = PhoneSystem.Root.GetTenants();
if (tenantArr.Length == 0)
{
throw new Exception("Corrupted database");
}
PhoneSystem.Root.Inserted += new NotificationEventHandler(Root_Inserted);
PhoneSystem.Root.Updated += new NotificationEventHandler(Root_Updated);
PhoneSystem.Root.Deleted += new NotificationEventHandler(Root_Deleted);
}
catch (Exception ex)
{
Library.WriteErrorLog(ex);
}
Many thanks in advance for your help!