PjSip ios assemblies implementation

epolonskiyepolonskiy RUMember
edited September 2015 in Cross Platform with Xamarin

I've build a lot of PjSip assemblies (18) from PjSip source code from official site using gettting started guide.
I added all the libs to my Xamarin ios project. But now I need to write -gcc_flags parameters and I can't figure out which exactly flags I need to write.
Is there anyone who succeded in this procedure and can help me?

Now my gcc_flags line looks like this one: --gcc_flags "-L${ProjectDir} -lMylib -framework CFNetwork -framework Foundation -framework AVFoundation -framework UIKit -framework AudioToolbox -framework CoreGraphics -force_load ${ProjectDir}/libg7221codec-apple-sdk_ios.a (and othe Pjsip assemblies)"

Thank you in advance


Best Answers


  • adamkempadamkemp USInsider, Developer Group Leader mod

    What does the PjSip documentation say to do?

  • epolonskiyepolonskiy RUMember

    @adamkemp It says nothing about linking. I guess it is because classic ios apps using xcode do not need gcc_flags to be used, but xamarin need it. Or maybe I'm a bit dumb =(

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Well you were given one or more binaries, right? Somehow those have to get linked in, even in Xcode. The instructions may be completely different, but it's still helpful to know what those instructions are. So where is the documentation for how to use this component in Xcode?

  • epolonskiyepolonskiy RUMember

    @adamkemp Here are PjSip Docs. But there is no word about linking them. As I remember In XCode you just need to include libs in project. There is no need to write gcc_flags when using XCode.
    I don't think there is any difference linking PjSip libs or any other c-libs in xamarin ios project.

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Can you list the libraries that are built?

  • epolonskiyepolonskiy RUMember

    @adamkemp Sure! This is the list:

    And the libs itself built for armv7, armv7s, arm64 and i386

  • adamkempadamkemp USInsider, Developer Group Leader mod

    You should follow the instructions here for each of those libraries. It looks like you have done "-L${ProjectDir}" and used "-force_load..." for each lib, but you haven't done "-l..." for each lib. You may also need to use the "-cxx" option if the library uses C++.

  • epolonskiyepolonskiy RUMember

    @adamkemp So did I understand you correctly? -l stands for internal name of the library in my project?
    I mean if I will link libraries like -gcc_flags "-L${ProjectDir} -framework Frameworkname1 -framework Frameworkname2 -lFirstLib -force_load ${ProjectDir}/libg7221codec-apple-sdk_ios.a -lSecondLib -force_load ${ProjectDir}/libgsmcodec-apple-sdk_ios.a (etc...)", In my c# wrapper I can use P/Invoke method like this:
    public static class CFuncs
    [DllImport("FirstLib"), EntryPoint="someFuncName"]
    internal static extern void someFuncName() { }

  • epolonskiyepolonskiy RUMember

    @adamkemp well, I see. I will try this solution in 10 hours and post here either it helped or not. Anyway thank you a lot!)

  • epolonskiyepolonskiy RUMember
    edited October 2015

    @adamkem That worked!)
    But now I get a lot of errors like:

    Native linking error: "operator delete(void*)", referenced from:
    Native linking error: "vtable for __cxxabiv1::__si_class_type_info", referenced from:
    Native linking error: pj::Account::create(pj::AccountConfig const&, bool) in libpjsua2-apple-sdk_ios.a(account.o)
    Native linking error: void std::__1::vector<pj::AuthCredInfo, std::__1::allocator >::__push_back_slow_path(pj::AuthCredInfo const&) in libpjsua2-apple-sdk_ios.a(account.o)

    ... And many many more

  • epolonskiyepolonskiy RUMember

    @adamkemp Yes, that helped)
    Thank you very much

  • I need to integrate Voip functionalities in my app. Can PJSIP be the right way? If so is it possibile to get somewhere the dll libraries to make some test? Thanks

  • epolonskiyepolonskiy RUMember

    @MatteoMonizza You can use PjSip to achieve the goal. But that would be a bit complicated. But I guess in xamarin it would be complicated anyway. You can get all you need to build app on official site pjsip.org. You build assemblies using the tutorial provided on their site. Integrate them in your app with p/invoke method and use in your app. We wrote some c-code to use libraries and made p/invoke class around that code

  • tstalzertstalzer ESMember

    @epolonskiy We are facing the same problem. Could you post some sample code from Xamarin to PJSIP?

Sign In or Register to comment.