FreeSWITCH.Native.ManagedSession.getCPtr C# (CSharp) Method

getCPtr() static private method

static private getCPtr ( ManagedSession obj ) : HandleRef
obj ManagedSession
return System.Runtime.InteropServices.HandleRef
        internal static HandleRef getCPtr(ManagedSession obj)
        {
            return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
        }

Usage Example

示例#1
0
 /// <summary>Initializes the native ManagedSession. Called after Originate completes successfully .</summary>
 internal void Initialize()
 {
     if (allocated == 0)
     {
         throw new InvalidOperationException("Cannot initialize a ManagedSession until it is allocated (originated successfully).");
     }
     // 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._hangupCallbackRef = hangupCallback;
     InitManagedSession(ManagedSession.getCPtr(this).Handle, this._inputCallbackRef, this._hangupCallbackRef);
     this._variables = new ChannelVariables(this);
 }