.NET Call-control-api/

Status
Not open for further replies.

Ronald Klitsche

Forum User
Joined
Sep 25, 2018
Messages
17
Reaction score
1
If you need additional information, like the DID, you need to use the 3CX Call Control API in a .NET Core program:
https://www.3cx.com/docs/call-control-api/
We've updated to Version 16 of 3CX and the .NET raise errors.
The link is invalid now.
Is the .NET API supported in this version and any help available?
 
We've updated to Version 16 of 3CX and the .NET raise errors.
The link is invalid now.
Is the .NET API supported in this version and any help available?
The API is available, but it's intended to be used internally only, so there is no documentation or support. If you worked with the API in the past, there are no major changes in v16 regarding the public interface. However, you need to rebuild your program using the latest version as a reference, because the interface at the binary level has changed a lot. You can take the latest version of the DLL from your 3CX installation.
 
Hi Ernesto, I've done this, but this doesnt work anymore.

Code:
instanceBinPath: C:\Program Files\3CX Phone System\Bin
System.BadImageFormatException: Die Datei oder Assembly "netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Es wurde versucht, eine Datei mit einem falschen Format zu laden.
Dateiname: "netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
   bei _3CXCallMonitor.TBUILDUPConnector.TMainProgram.Bootstrap(String filePath)
   bei _3CXCallMonitor.TBUILDUPConnector.TMainProgram.Execute()
 
A BadImageFormatException usually happens when you try to load a 32 bits DLL from a 64 bits app, or a 64 bits DLL from a 32 bits app. You should check the Target Platform of your program, and the DLLs that you're referencing...
 
The 3cxpscomcpp2.dll is 32Bit. I load it with from a 32 Bit program.

The 3cxpscomcpp2.dll has a reference to netstandard.dll coming which the installation and placed
in same directory "C:\Program Files\3CX Phone System\Bin" but it's 64 Bit.

Is that correct?
 
No, 3CX is 64 bits. There is no 32 bits version. Your program needs to be 64 bits.
 
C:\Program Files\3CX Phone System\Bin\3cxpscomcpp2.dll
Version: 16.0.3.676
reported as a 32Bit DLL.
 
reported as a 32Bit DLL.
I don't know from where you're getting this, but that's WRONG.
12841

MSIL means that this is a .NET AnyCPU DLL. And let me add that this DLL is designed to run on x64 machines only, and that's why you can't install 3CX on a 32 bits machine. This DLL has a dependency on the library "tcxpscom_native.dll", which is a 64 bits native (not .NET) DLL. So this can't be loaded by a 32 bits program.

Just change the target platform of your program to x64.
 
That's the error of the 64Bit version:

Code:
instanceBinPath: C:\Program Files\3CX Phone System\Bin
System.TypeInitializationException: Der Typeninitialisierer für "TCX.Configuration.PhoneSystem" hat eine Ausnahme verursacht. ---> System.TypeInitializationException: Der Typeninitialisierer für "TCX.Configuration.Interop.Wconnection" hat eine Ausnahme verursacht. ---> System.TypeInitializationException: Der Typeninitialisierer für "TCX.Configuration.Interop.WParamListHolder`1" hat eine Ausnahme verursacht. ---> System.TypeLoadException: Der Typ "System.Runtime.InteropServices.SafeHandle" in der Assembly "netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" konnte nicht geladen werden.
   bei TCX.Configuration.Interop.WParamListHolder`1..cctor()
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei TCX.Configuration.Interop.WParamListHolder`1.set_ClassName(String value)
   bei TCX.Configuration.Interop.Wconnection..cctor()
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei TCX.Configuration.Interop.Wconnection..ctor()
   bei TCX.Configuration.PhoneSystem..cctor()
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei TCX.Configuration.PhoneSystem.get_ApplicationName()
   bei _3CXCallMonitor.TBUILDUPConnector.TMainProgram.Bootstrap(String filePath)
   bei _3CXCallMonitor.TBUILDUPConnector.TMainProgram.Execute()

Any idea what's wrong?
 
Seems to be a missing DLL. Try running your program from the 3CX installation folder, so you're sure that all the DLLs are in place.
 
done. The error message is the same.
 
Status
Not open for further replies.

Forum statistics

Threads
112,325
Messages
591,898
Members
165,479
Latest member
Senergia