PJSip in android

you can get help from this site

http://pjsip.org

http://trac.pjsip.org/repos/wiki/AutomatedTesting

http://www.pjsip.org/pjsua.htm


You do not have to use third-party libraries to build SIP client functionality in Android. Android includes a full fledged SIP API. You can take a look at SIP demo to understand how to use SIP APIs for a walkie-talkie type of implementation.


The accepted answer isn't entirely accurate. There are many desirable features missing from the Android SIP API that you may wish to achieve via a 3rd-party library.

With respect to the aforementioned pjsip, I've spent a great deal of time experimenting with the Android build of pjsip, and truthfully the only way to get reliable instantaneous registration to work as documented is to build the OpenSSL 1.0.2a library and pass it at configure time. Then in Java you need to attempt (and fail) to enable TLS communication, just as you see them do for UDP and TCP. Here is what I mean:

  /* Create transports. */
  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 your own app.

I'm not entirely sure why, but this is necessary for me. Otherwise, the registration process is semi-nondeterministic, in the sense that it will work after failing a few times, or fail for 5 minutes then suddenly succeed, etc. It seems to get confused after the 1st registration.

Here is how I configured:

TARGET_ABI=arm64-v8a ./configure-android --use-ndk-cflags --with-ssl=`pwd`/../3rd-party/openssl-1.0.2a

And that was after following the proper Android instructions, exrtacting the OpenSSL tarball into a folder above pjsip ../3rd-party/ and first building there. I described that process in some detail in a previous post.

Tags:

Android

Pjsip