I am using Julmar ATAPI for creating an application which allows answering and making calls via TAPI. It was running well for most PhoneSystems. But with 3CX I get an exception when calling:
tapi = new TapiManager("AwesomeApp");
tapi.Initialize();
tapi.Lines[cbLines.SelectedIndex].Open(MediaModes.All);
line = tapiManager.Lines[cbLines.SelectedIndex];
line.MakeCall(tbPhoneNumber.Text);
The MakeCall-Line throws the following exception:
Name: ObjectDisposedException
Source: mscorlib
Site: Void DangerousAddRef(Boolean ByRef)
Message: Das SafeHandle wurde geschlossen. //The SafeHandle has been closed.
StackTrace: bei System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success)
bei System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success)
bei JulMar.Atapi.Interop.NativeMethods.lineGetCallStatus(HTCALL hCall, IntPtr lpCallStatus)
bei JulMar.Atapi.TapiCall.GatherCallStatus()
bei JulMar.Atapi.TapiCall..ctor(TapiAddress addrOwner, UInt32 hCall)
bei JulMar.Atapi.TapiAddress.MakeCall(String address, Int32 countryCode, MakeCallParams param)
bei System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
bei System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
...
I am clueless by now as this problem does not occur on Swyx, NFON and bintec elmeg as tested so far.
I've found this post referred by an issue of the ATAPI Project, but I don't quite understand what needs to be done for the fix and I get the feeling, that the intention was to create an own MakeCall funcion? At least I have not seen any ATAPI-Calls. The Application is a x64 deployment on a x64 client.
Now...even though I have not got much more code to provide, and a reproducable Example is probably almost impossible as this might even be client-dependent thing, I hope you could give me some hints on what is happening in the background which might cause this error. Is this a bug inside ATAPI? Is this a Problem caused by the TAPI-Provider? Is this a Problem I can fix in my code?
EDIT: Incoming calls seem to work...So why is this only happening during MakeCall? EDIT2: According to the Line-Capabilities MakeCall is supported.
Thank you very much in advance!