updated pjsip stack
There is still a bug on incoming calls when buiding for android
diff --git a/jni/pjproject-android/configure-android b/jni/pjproject-android/configure-android
index 8620f60..ca5d9f0 100755
--- a/jni/pjproject-android/configure-android
+++ b/jni/pjproject-android/configure-android
@@ -16,11 +16,12 @@
   echo "Environment variables:"
   echo "  ANDROID_NDK_ROOT Specify the directory of Android NDK to use."
   echo "  APP_PLATFORM     Optionally specify the platform level used, e.g."
-  echo "                   android-8. By default, configure will use the maximum"
-  echo "                   platform level detected."
-  echo "  TARGET_ABI       Optionally specify a single target architecture, e.g."
-  echo "                   armeabi-v7a. By default, the target architecture is"
-  echo "                   armeabi."
+  echo "                   android-9. By default, configure will use the"
+  echo "                   maximum platform level detected."
+  echo "  TARGET_ABI       Optionally specify a single target architecture,"
+  echo "                   e.g. armeabi-v7a, mips, x86. By default, the target"
+  echo "                   architecture is armeabi. Only used when"
+  echo "                   --use-ndk-cflags is specified."
   echo ""
   exit 0
 fi
@@ -53,50 +54,70 @@
 
 if test "$1" = "--use-ndk-cflags"; then
   shift
+  ADD_CFLAGS="1"
   for i in `${ANDROID_NDK_ROOT}/ndk-build -n -C ${ANDROID_NDK_ROOT}/samples/hello-jni NDK_LOG=1 APP_PLATFORM=${APP_PLATFORM} APP_ABI=${TARGET_ABI}`; do
-    if test "$i" = "-c"; then break; fi
-    if test "x${NDK_CC}" != "x" -a "$i" != "-MF" -a "x`echo $i|grep '\.o\.d'`" = "x" -a "x`echo $i|grep 'include'`" = "x"; then
-      NDK_CFLAGS="${NDK_CFLAGS} $i"
+    if test "x${NDK_CXX}" != "x" -a "$i" = "-o"; then break; fi
+
+    # Parse NDK CXXFLAGS
+    if test "x${NDK_CXX}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x"; then
+      if test "x`echo $i|grep '\-\-sysroot='`" != "x"; then
+        ANDROID_SYSROOT=`echo $i|sed 's/--sysroot=//'`;
+      fi
+      NDK_CXXFLAGS="${NDK_CXXFLAGS} $i"
     fi
-    if test "x`echo $i | grep 'gcc'`" != "x"; then
+
+    # Parse NDK CFLAGS
+    if test "x${NDK_CC}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x" -a "x`echo $i|grep '\-M'`" = "x" -a "${ADD_CFLAGS}" = "1"; then
+      if test "$i" = "-c"; then ADD_CFLAGS="0"; else
+        NDK_CFLAGS="${NDK_CFLAGS} $i"
+      fi
+    fi
+
+    # Find gcc toolchain
+    if test "x${NDK_CC}" = "x" -a "x`echo $i | grep 'gcc'`" != "x"; then
       NDK_CC=$i
     fi
+    # Find g++ toolchain
+    if test "x`echo $i | grep 'g++'`" != "x"; then
+      NDK_CXX=$i
+    fi
   done
+
+  export CC="${NDK_CC}"
+  export CXX="${NDK_CXX}"
+
+  export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"
+  export LIBS="${LIBS} -lc -lgcc"
   export CFLAGS="${CFLAGS} ${NDK_CFLAGS}"
+  export CPPFLAGS="${CFLAGS}"
+  export CXXFLAGS="${NDK_CXXFLAGS}"
+
+else
+
+  ANDROID_TC_VER=`ls -d ${ANDROID_NDK_ROOT}/toolchains/${TC_DIR}-* | sed 's/clang/0/' | sort -gr | head -1`
+  ANDROID_TC=`ls -d ${ANDROID_TC_VER}/prebuilt/*`
+  if test ! -d ${ANDROID_TC}; then
+    echo "$F error: unable to find directory ${ANDROID_TC} in Android NDK"
+    exit 1
+  fi
+
+  export ANDROID_SYSROOT="${ANDROID_NDK_ROOT}/platforms/${APP_PLATFORM}/arch-arm"
+  if test ! -d ${ANDROID_SYSROOT}; then
+    echo "$F error: unable to find sysroot dir ${ANDROID_SYSROOT} in Android NDK"
+    exit 1
+  fi
+
+  export CC="${ANDROID_TC}/bin/${TARGET_HOST}-gcc"
+  export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++"
+
+  export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"
+  export LIBS="${LIBS} -lc -lgcc"
+  export CFLAGS="${CFLAGS} -I${ANDROID_SYSROOT}/usr/include"
+  export CPPFLAGS="${CFLAGS}"
+  export CXXFLAGS="${CXXFLAGS} -shared --sysroot=${ANDROID_SYSROOT}"
+
 fi
 
-HOST_OS=$(uname -s)
-case $HOST_OS in
-  Darwin) BUILD_MACHINE="darwin-x86";;
-  Linux) BUILD_MACHINE="linux-x86";;
-  CYGWIN*|*_NT-*) BUILD_MACHINE="windows";;
-esac
-
-case $(uname -p) in
-	x86_64) BUILD_MACHINE="linux-x86_64"
-esac
-
-ANDROID_TC="${ANDROID_NDK_ROOT}/toolchains/${TC_DIR}-4.8/prebuilt/${BUILD_MACHINE}"
-if test ! -d ${ANDROID_TC}; then
-  echo "$F error: unable to find directory ${ANDROID_TC} in Android NDK"
-  exit 1
-fi
-
-export ANDROID_SYSROOT="${ANDROID_NDK_ROOT}/platforms/${APP_PLATFORM}/arch-arm"
-if test ! -d ${ANDROID_SYSROOT}; then
-  echo "$F error: unable to find sysroot dir ${ANDROID_SYSROOT} in Android NDK"
-  exit 1
-fi
-
-export CC="${ANDROID_TC}/bin/${TARGET_HOST}-gcc"
-export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++"
-
-export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"
-export LIBS="${LIBS} -lc -lgcc"
-export CFLAGS="${CFLAGS} -I${ANDROID_SYSROOT}/usr/include"
-export CPPFLAGS="${CFLAGS}"
-export CXXFLAGS="${CXXFLAGS} -shared --sysroot=${ANDROID_SYSROOT}"
-
 # Print settings
 if test "1" = "1"; then
   echo "$F: calling ./configure with env vars:"
@@ -108,4 +129,4 @@
   echo " LIBS = ${LIBS}"
 fi
 
-./configure --host=${TARGET_HOST} --disable-sound --disable-oss --disable-video --enable-ext-sound --disable-speex-aec --disable-g711-codec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-sdl --disable-ffmpeg --disable-v4l2 $*
+./configure --host=${TARGET_HOST} --disable-video $*