P/Invoke should do all the work for us

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9797 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Giagnocavo committed 2008-10-02 18:59:09 +00:00
1 parent b66e1bad4c
commit 657a0c9ac0
4 files changed
+21 -15

No files matched your search

@@ -47,8 +47,16 @@ namespace FreeSWITCH.Native
/// <summary>Initializes the native ManagedSession. Must be called after Originate.</summary>
public void Initialize()
{
// P/Invoke generated function pointers stick around until the delegate is collected
// By sticking the delegates in fields, their lifetime won't be less than the session
// So we don't need to worry about GCHandles and all that....
// Info here: http://blogs.msdn.com/cbrumme/archive/2003/05/06/51385.aspx
this._inputCallbackRef = inputCallback;
this._hangupCallback = hangupCallback;
InitManagedSession(ManagedSession.getCPtr(this).Handle, inputCallback, hangupCallback);
}
DtmfCallback _inputCallbackRef;
Action _hangupCallback;
/// <summary>Function to execute when this session hangs up.</summary>
public Action HangupFunction { get; set; }