{\r
// SWITCH_DECLARE(void) InitManagedSession(ManagedSession *session, MonoObject *dtmfDelegate, MonoObject *hangupDelegate)\r
[DllImport("mod_managed.dll", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]\r
- static extern void InitManagedSession(IntPtr sessionPtr, DtmfCallback dtmfDelegate, Action hangupDelegate);\r
+ static extern void InitManagedSession(IntPtr sessionPtr, DtmfCallback dtmfDelegate, CdeclAction hangupDelegate);\r
\r
/// <summary>Initializes the native ManagedSession. Must be called after Originate.</summary>\r
public void Initialize()\r
// So we don't need to worry about GCHandles and all that....\r
// Info here: http://blogs.msdn.com/cbrumme/archive/2003/05/06/51385.aspx\r
this._inputCallbackRef = inputCallback;\r
- this._hangupCallback = hangupCallback;\r
- InitManagedSession(ManagedSession.getCPtr(this).Handle, inputCallback, hangupCallback);\r
+ this._hangupCallbackRef = hangupCallback;\r
+ InitManagedSession(ManagedSession.getCPtr(this).Handle, this._inputCallbackRef, this._hangupCallbackRef);\r
}\r
DtmfCallback _inputCallbackRef;\r
- CdeclAction _hangupCallback;\r
+ CdeclAction _hangupCallbackRef;\r
\r
/// <summary>Function to execute when this session hangs up.</summary>\r
public Action HangupFunction { get; set; }\r