I think I remember seeing that symptom (iaxclient crashes after first time =
the callback function returns) when I had the wrong calling convention on t=
he callback type. The '[UnmanagedFunctionPointer(CallingConvention.StdCall=
)] internal delegate int iaxc_event_callback_t(iaxc_event e);' line you men=
tion is declaring that the .NET callback function is to be exposed as a std=
call function. Perhaps your DLL is compiled differently to mine and is exp=
ecting it to be cdecl. If you change it to '[UnmanagedFunctionPointer(Call=
ingConvention.CDecl)] internal delegate int iaxc_event_callback_t(iaxc_even=
t e);' that might work - do let me know.
From: Sergio Cinos
Sent: Thu 09/08/07 18:03
Subject: [Iaxclient-devel] Exception in DotNetWrapper, IAXCallback() method
I'm using iaxclient.dll and IAXClientDotNetWrapper, but after registering t=
o Asterisk, I get a unhandled exception. After some debugging and investiga=
tion, I found that:
- There is a first call to IAXCallback (with a IAXC_EVENT_LEVELS event)
- After finishing that call, the exception arises (running step by step don=
't show any code executed after IAXCallback finish).
- ev.next value is 0x000000, that evaluates as null, so IAXCallback returns=
- If I comment 'IAXUnmanaged.iaxc_set_event_callback(CallbackDelegate);' IA=
XCallback is never called, and there is no error in that case.
I'm not a C# or .net expert, so I don't understand very well what the probl=
em is. I think I cannot manage the exception because it is involved in usin=
g a Unmanaged delegate '[UnmanagedFunctionPointer(CallingConvention.StdCall=
)] internal delegate int iaxc_event_callback_t(iaxc_event e);'.
Is there some problem related to IAXCallback()? I'm using a precompiled iax=
client.dll. Maybe my dll version is not up to date? Do you think that I sho=
uld compile iaxclient.dll myself to solve the unhandled exception problem?
Thanks in advance,
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Iaxclient-devel mailing list