The accepted answer is not entirely accurate. There are many desirable features missing from the Android SIP API that you might want to achieve through a third-party library.
Regarding the aforementioned pjsip, I spent a lot of time experimenting with building Android pjsip, and frankly, the only way to get reliable instant registration for work, as documented, is to build the OpenSSL 1.0.2a library and pass it on during setup. Then in Java you need to try (and fail) to enable TLS communication, as you can see, for UDP and TCP. Here is what I mean:
try { transports.add( ep.transportCreate(pjsip_transport_type_e.PJSIP_TRANSPORT_TLS, transportConfig) ); } catch (Throwable t2) { SipManager.log().e(t2); } try { transports.add( ep.transportCreate(pjsip_transport_type_e.PJSIP_TRANSPORT_UDP, transportConfig) ); } catch (Throwable t) { SipManager.log().e(t); } try { transports.add( ep.transportCreate(pjsip_transport_type_e.PJSIP_TRANSPORT_TCP, transportConfig) ); } catch (Throwable t) { SipManager.log().e(t); }
Replace the SipManager.log()
calls for the native application.
I do not quite understand why, but it is necessary for me. Otherwise, the registration process is semi-deterministic, in the sense that it will work after failure several times or will not work for 5 minutes, and then unexpectedly succeed, etc. He seems confused after the first registration.
Here is how I set up:
TARGET_ABI=arm64-v8a ./configure-android --use-ndk-cflags --with-ssl=`pwd`/../3rd-party/openssl-1.0.2a
And that was after the following correct instructions for Android , exrtacting the OpenSSL tarball to the folder above pjsip ../3rd-party/
and the first building there. I described this process in detail in a previous post .
source share