Resolve attempt to JIT for PJSIP (PJSUA2) C# on Xamarin.iOS AOT only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am using PJSIP (PJSUA2) in Xamarin.Android and Xamarin.iOS projects using C#.  PJSIP (PJSUA2) utilizes SWIG to generate the Java and C# bindings for the C++ library. 

I am new to SWIG and am having difficulties understanding how to best use SWIG on C++ Callbacks to generate appropriate SWIG C# for iOS which is AOT only. ( SWIG C# for java/Android works great since JIT is allowed ) 

I have resolved the pjsua2PINVOKE.SWIGExceptionHelper class: 
1. Added the [ObjCRuntime.MonoNativeFunctionWrapper] descriptor to the delegates 
2. Added the [ObjCRuntime.MonoPInvokeCallback(typeof(ExceptionDelegate))] descriptor to the static functions. 

Now I have encountered issues with callbacks using directors, how do I resolve? 

Call.cs SWIG generated code: 

  [ObjCRuntime.MonoNativeFunctionWrapper] 
  public delegate void SwigDelegateCall_0(global::System.IntPtr prm); 

  [ObjCRuntime.MonoPInvokeCallback(typeof(SwigDelegateCall_0))] 
  private void SwigDirectoronCallState(global::System.IntPtr prm) { 
    onCallState(new OnCallStateParam(prm, false)); 
  } 

1. Added [ObjCRuntime.MonoNativeFunctionWrapper] descriptor to the delgates 
2. Attempted to add [ObjCRuntime.MonoPInvokeCallback(typeof(SwigDelegateCall_0))] descriptor, but it won't work on non-static functions.   

What is the best practice for having SWIG generate the appropriate Callbacks? 

Thank you for your time and assistance, 
~Casey 
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux