bridge_native_rtp: Fix T.38 issues with remote bridges
[asterisk/asterisk.git] / configure
index 84de43a..eb40744 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 405130 .
+# From configure.ac Revision: 425966 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for asterisk trunk.
 #
@@ -649,7 +649,6 @@ CONFIG_SDL
 PBX_SO_NOSIGPIPE
 PBX_MSG_NOSIGNAL
 PBX_IXJUSER
-PBX_H323
 GMIME_LIBS
 GMIME_CFLAGS
 OPENH323_BUILD
@@ -891,6 +890,10 @@ PBX_PRI_L2_PERSISTENCE
 PRI_L2_PERSISTENCE_DIR
 PRI_L2_PERSISTENCE_INCLUDE
 PRI_L2_PERSISTENCE_LIB
+PBX_PRI_SETUP_ACK_INBAND
+PRI_SETUP_ACK_INBAND_DIR
+PRI_SETUP_ACK_INBAND_INCLUDE
+PRI_SETUP_ACK_INBAND_LIB
 PBX_PRI
 PRI_DIR
 PRI_INCLUDE
@@ -927,6 +930,10 @@ PBX_OSPTK
 OSPTK_DIR
 OSPTK_INCLUDE
 OSPTK_LIB
+PBX_OPUS
+OPUS_DIR
+OPUS_INCLUDE
+OPUS_LIB
 PBX_OPENR2
 OPENR2_DIR
 OPENR2_INCLUDE
@@ -1075,6 +1082,10 @@ PBX_DAHDI
 DAHDI_DIR
 DAHDI_INCLUDE
 DAHDI_LIB
+PBX_OPENSSL_EC
+OPENSSL_EC_DIR
+OPENSSL_EC_INCLUDE
+OPENSSL_EC_LIB
 PBX_OPENSSL_SRTP
 OPENSSL_SRTP_DIR
 OPENSSL_SRTP_INCLUDE
@@ -1175,6 +1186,7 @@ LD
 CXX
 PBX_OSREV
 UNAME
+CONFIG_SIGNED_CHAR
 PBX_WINARCH
 OSARCH
 HOST_OS
@@ -1307,6 +1319,7 @@ with_netsnmp
 with_newt
 with_ogg
 with_openr2
+with_opus
 with_osptk
 with_oss
 with_postgres
@@ -2044,6 +2057,7 @@ Optional Packages:
   --with-newt=PATH        use newt files in PATH
   --with-ogg=PATH         use OGG files in PATH
   --with-openr2=PATH      use MFR2 files in PATH
+  --with-opus=PATH        use Opus files in PATH
   --with-osptk=PATH       use OSP Toolkit files in PATH
   --with-oss=PATH         use Open Sound System files in PATH
   --with-postgres=PATH    use PostgreSQL files in PATH
@@ -4805,6 +4819,35 @@ esac
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5
+$as_echo_n "checking whether char is unsigned... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+               #include <limits.h>
+#if CHAR_MIN == 0
+#error
+#endif
+
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CONFIG_SIGNED_CHAR=""
+
+else
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CONFIG_SIGNED_CHAR="-fsigned-char"
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 #  check for uname
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}uname", so it can be a program name with args.
@@ -8490,6 +8533,18 @@ PBX_OPENSSL_SRTP=0
 
 
 
+OPENSSL_EC_DESCRIP="OpenSSL Elliptic Curve Support"
+OPENSSL_EC_OPTION=crypto
+OPENSSL_EC_DIR=${CRYPTO_DIR}
+
+PBX_OPENSSL_EC=0
+
+
+
+
+
+
+
     DAHDI_DESCRIP="DAHDI"
     DAHDI_OPTION="dahdi"
     PBX_DAHDI=0
@@ -9999,6 +10054,38 @@ fi
 
 
 
+    OPUS_DESCRIP="Opus"
+    OPUS_OPTION="opus"
+    PBX_OPUS=0
+
+# Check whether --with-opus was given.
+if test "${with_opus+set}" = set; then :
+  withval=$with_opus;
+       case ${withval} in
+       n|no)
+       USE_OPUS=no
+       # -1 is a magic value used by menuselect to know that the package
+       # was disabled, other than 'not found'
+       PBX_OPUS=-1
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} OPUS"
+       ;;
+       *)
+       OPUS_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} OPUS"
+       ;;
+       esac
+
+fi
+
+
+
+
+
+
+
+
     OSPTK_DESCRIP="OSP Toolkit"
     OSPTK_OPTION="osptk"
     PBX_OSPTK=0
 
 
 
+PRI_SETUP_ACK_INBAND_DESCRIP="ISDN PRI progress inband ie in SETUP ACK"
+PRI_SETUP_ACK_INBAND_OPTION=pri
+PRI_SETUP_ACK_INBAND_DIR=${PRI_DIR}
+
+PBX_PRI_SETUP_ACK_INBAND=0
+
+
+
+
+
+
+
 PRI_L2_PERSISTENCE_DESCRIP="ISDN Layer 2 persistence option"
 PRI_L2_PERSISTENCE_OPTION=pri
 PRI_L2_PERSISTENCE_DIR=${PRI_DIR}
@@ -12635,128 +12734,9 @@ if test "x$JANSSON_LIB" == "x"; then
 fi
 
 
-if test "x${PBX_URIPARSER}" != "x1" -a "${USE_URIPARSER}" != "no"; then
-   pbxlibdir=""
-   # if --with-URIPARSER=DIR has been specified, use it.
-   if test "x${URIPARSER_DIR}" != "x"; then
-      if test -d ${URIPARSER_DIR}/lib; then
-         pbxlibdir="-L${URIPARSER_DIR}/lib"
-      else
-         pbxlibdir="-L${URIPARSER_DIR}"
-      fi
-   fi
-   pbxfuncname="uriParseUriA"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_URIPARSER_FOUND=yes
-   else
-      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
-      CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_uriparser_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -luriparser" >&5
-$as_echo_n "checking for ${pbxfuncname} in -luriparser... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-luriparser ${pbxlibdir}  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
-else
-  eval "$as_ac_Lib=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-eval ac_res=\$$as_ac_Lib
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
-  AST_URIPARSER_FOUND=yes
-else
-  AST_URIPARSER_FOUND=no
-fi
-
-      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
-
-   # now check for the header.
-   if test "${AST_URIPARSER_FOUND}" = "yes"; then
-      URIPARSER_LIB="${pbxlibdir} -luriparser "
-      # if --with-URIPARSER=DIR has been specified, use it.
-      if test "x${URIPARSER_DIR}" != "x"; then
-         URIPARSER_INCLUDE="-I${URIPARSER_DIR}/include"
-      fi
-      URIPARSER_INCLUDE="${URIPARSER_INCLUDE} "
-      if test "xuriparser/Uri.h" = "x" ; then  # no header, assume found
-         URIPARSER_HEADER_FOUND="1"
-      else                             # check for the header
-         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${URIPARSER_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "uriparser/Uri.h" "ac_cv_header_uriparser_Uri_h" "$ac_includes_default"
-if test "x$ac_cv_header_uriparser_Uri_h" = xyes; then :
-  URIPARSER_HEADER_FOUND=1
-else
-  URIPARSER_HEADER_FOUND=0
-fi
-
-
-         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
-      if test "x${URIPARSER_HEADER_FOUND}" = "x0" ; then
-         URIPARSER_LIB=""
-         URIPARSER_INCLUDE=""
-      else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            URIPARSER_LIB=""
-         fi
-         PBX_URIPARSER=1
-         cat >>confdefs.h <<_ACEOF
-#define HAVE_URIPARSER 1
-_ACEOF
-
-      fi
-   fi
-fi
-
-
-
-# Another mandatory item (unless it's explicitly disabled)
-# Check whether --enable-xmldoc was given.
-if test "${enable_xmldoc+set}" = set; then :
-  enableval=$enable_xmldoc; case "${enableval}" in
-               y|ye|yes) disable_xmldoc=no ;;
-               n|no)  disable_xmldoc=yes ;;
-               *) as_fn_error $? "bad value ${enableval} for --disable-xmldoc" "$LINENO" 5  ;;
-       esac
-else
-  disable_xmldoc=no
-fi
-
-
-if test "${disable_xmldoc}" != "yes"; then
-
-    if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then
-       PBX_LIBXML2=0
-       if test -n "$ac_tool_prefix"; then
+               if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then
+               PBX_LIBXML2=0
+               if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}xml2-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}xml2-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -12856,66 +12836,182 @@ else
   CONFIG_LIBXML2="$ac_cv_path_CONFIG_LIBXML2"
 fi
 
-       if test ! "x${CONFIG_LIBXML2}" = xNo; then
-           if test x"" = x ; then A=--cflags ; else A="" ; fi
-           LIBXML2_INCLUDE=$(${CONFIG_LIBXML2} $A)
-           if test x"" = x ; then A=--libs ; else A="" ; fi
-           LIBXML2_LIB=$(${CONFIG_LIBXML2} $A)
-           if test x"#include <libxml/tree.h>
-       #include <libxml/parser.h>" != x ; then
-               saved_cppflags="${CPPFLAGS}"
-               if test "x${LIBXML2_DIR}" != "x"; then
-                   LIBXML2_INCLUDE="-I${LIBXML2_DIR}/include"
-               fi
-               CPPFLAGS="${CPPFLAGS} ${LIBXML2_INCLUDE}"
+               if test ! "x${CONFIG_LIBXML2}" = xNo; then
+                       if test x"" = x ; then A=--cflags ; else A="" ; fi
+                       LIBXML2_INCLUDE=$(${CONFIG_LIBXML2} $A)
+                       LIBXML2_INCLUDE=$(echo ${LIBXML2_INCLUDE} | $SED -e "s|-I|-I${LIBXML2_DIR}|g")
 
-               saved_libs="${LIBS}"
-               LIBS="${LIBXML2_LIB}"
+                       if test x"" = x ; then A=--libs ; else A="" ; fi
+                       LIBXML2_LIB=$(${CONFIG_LIBXML2} $A)
+                       LIBXML2_LIB=$(echo ${LIBXML2_LIB} | $SED -e "s|-L|-L${LIBXML2_DIR}|g")
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                       if test x"#include <libxml/tree.h>
+        #include <libxml/parser.h>" != x ; then
+                               saved_cppflags="${CPPFLAGS}"
+                               CPPFLAGS="${CPPFLAGS} ${LIBXML2_INCLUDE}"
+
+                               saved_libs="${LIBS}"
+                               LIBS=${LIBXML2_LIB}
+
+                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
   #include <libxml/tree.h>
-       #include <libxml/parser.h>
+        #include <libxml/parser.h>
 int
 main ()
 {
  LIBXML_TEST_VERSION;
-
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-     PBX_LIBXML2=1
-
+   PBX_LIBXML2=1
 $as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
 
-
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-               CPPFLAGS="${saved_cppflags}"
-               LIBS="${saved_libs}"
-           else
-               PBX_LIBXML2=1
+                               CPPFLAGS="${saved_cppflags}"
+                               LIBS="${saved_libs}"
+                       else
+                               PBX_LIBXML2=1
 
 $as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
 
-           fi
+                       fi
+               fi
        fi
-    fi
 
-       if test "${PBX_LIBXML2}" != 1; then
-               { $as_echo "$as_me:${as_lineno-$LINENO}: *** XML documentation will not be available because the 'libxml2' development package is missing." >&5
-$as_echo "$as_me: *** XML documentation will not be available because the 'libxml2' development package is missing." >&6;}
-               { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please run the 'configure' script with the '--disable-xmldoc' parameter option" >&5
-$as_echo "$as_me: *** Please run the 'configure' script with the '--disable-xmldoc' parameter option" >&6;}
-               { $as_echo "$as_me:${as_lineno-$LINENO}: *** or install the 'libxml2' development package." >&5
-$as_echo "$as_me: *** or install the 'libxml2' development package." >&6;}
-               exit 1
-       fi
+
+if test "${PBX_LIBXML2}" != 1; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: *** The Asterisk menuselect tool requires the 'libxml2' development package." >&5
+$as_echo "$as_me: *** The Asterisk menuselect tool requires the 'libxml2' development package." >&6;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please install the 'libxml2' development package." >&5
+$as_echo "$as_me: *** Please install the 'libxml2' development package." >&6;}
+       exit 1
+fi
+
+
+if test "x${PBX_URIPARSER}" != "x1" -a "${USE_URIPARSER}" != "no"; then
+   pbxlibdir=""
+   # if --with-URIPARSER=DIR has been specified, use it.
+   if test "x${URIPARSER_DIR}" != "x"; then
+      if test -d ${URIPARSER_DIR}/lib; then
+         pbxlibdir="-L${URIPARSER_DIR}/lib"
+      else
+         pbxlibdir="-L${URIPARSER_DIR}"
+      fi
+   fi
+   pbxfuncname="uriParseUriA"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_URIPARSER_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      as_ac_Lib=`$as_echo "ac_cv_lib_uriparser_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -luriparser" >&5
+$as_echo_n "checking for ${pbxfuncname} in -luriparser... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luriparser ${pbxlibdir}  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  AST_URIPARSER_FOUND=yes
+else
+  AST_URIPARSER_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_URIPARSER_FOUND}" = "yes"; then
+      URIPARSER_LIB="${pbxlibdir} -luriparser "
+      # if --with-URIPARSER=DIR has been specified, use it.
+      if test "x${URIPARSER_DIR}" != "x"; then
+         URIPARSER_INCLUDE="-I${URIPARSER_DIR}/include"
+      fi
+      URIPARSER_INCLUDE="${URIPARSER_INCLUDE} "
+      if test "xuriparser/Uri.h" = "x" ; then  # no header, assume found
+         URIPARSER_HEADER_FOUND="1"
+      else                             # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${URIPARSER_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "uriparser/Uri.h" "ac_cv_header_uriparser_Uri_h" "$ac_includes_default"
+if test "x$ac_cv_header_uriparser_Uri_h" = xyes; then :
+  URIPARSER_HEADER_FOUND=1
+else
+  URIPARSER_HEADER_FOUND=0
+fi
 
 
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${URIPARSER_HEADER_FOUND}" = "x0" ; then
+         URIPARSER_LIB=""
+         URIPARSER_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+            URIPARSER_LIB=""
+         fi
+         PBX_URIPARSER=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_URIPARSER 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+# Another mandatory item (unless it's explicitly disabled)
+# Check whether --enable-xmldoc was given.
+if test "${enable_xmldoc+set}" = set; then :
+  enableval=$enable_xmldoc; case "${enableval}" in
+               y|ye|yes) disable_xmldoc=no ;;
+               n|no)  disable_xmldoc=yes ;;
+               *) as_fn_error $? "bad value ${enableval} for --disable-xmldoc" "$LINENO" 5  ;;
+       esac
+else
+  disable_xmldoc=no
+fi
+
+
+if test "${disable_xmldoc}" != "yes"; then
+
 if test "x${PBX_LIBXSLT}" != "x1" -a "${USE_LIBXSLT}" != "no"; then
    pbxlibdir=""
    # if --with-LIBXSLT=DIR has been specified, use it.
@@ -13190,7 +13286,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -13236,7 +13332,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -13260,7 +13356,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -13305,7 +13401,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -13329,7 +13425,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -13878,6 +13974,43 @@ _ACEOF
 
 fi
 
+stat_nsec_found=no
+ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "#include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_mtim" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_MTIM 1
+_ACEOF
+
+stat_nsec_found=yes
+fi
+ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimensec" "ac_cv_member_struct_stat_st_mtimensec" "#include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_mtimensec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_MTIMENSEC 1
+_ACEOF
+
+stat_nsec_found=yes
+fi
+ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec" "ac_cv_member_struct_stat_st_mtimespec" "#include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1
+_ACEOF
+
+stat_nsec_found=yes
+fi
+
+
+if test "${stat_nsec_found}" != yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot determine nanosecond field of struct stat" >&5
+$as_echo "$as_me: WARNING: Cannot determine nanosecond field of struct stat" >&2;}
+fi
 
 # Checks for library functions.
 for ac_header in unistd.h
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h" >&5
+$as_echo_n "checking for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+int a = PTHREAD_MUTEX_ADAPTIVE_NP;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PTHREAD_MUTEX_ADAPTIVE_NP 1" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_spinlock_t in pthread.h" >&5
+$as_echo_n "checking for pthread_spinlock_t in pthread.h... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+pthread_spinlock_t spin;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PTHREAD_SPINLOCK 1" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
 save_LIBS="$LIBS"
 save_CFLAGS="$CFLAGS"
 LIBS="$PTHREAD_LIBS $LIBS"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FORTIFY_SOURCE support" >&5
 $as_echo_n "checking for _FORTIFY_SOURCE support... " >&6; }
-if $(${CC} -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+if $(${CC} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-       AST_FORTIFY_SOURCE=-D_FORTIFY_SOURCE=2
+       AST_FORTIFY_SOURCE="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
 else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -21571,9 +21758,9 @@ fi
 fi
 
 
-    if test "x${PBX_MYSQLCLIENT}" != "x1" -a "${USE_MYSQLCLIENT}" != "no"; then
-       PBX_MYSQLCLIENT=0
-       if test -n "$ac_tool_prefix"; then
+               if test "x${PBX_MYSQLCLIENT}" != "x1" -a "${USE_MYSQLCLIENT}" != "no"; then
+               PBX_MYSQLCLIENT=0
+               if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}mysql_config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}mysql_config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -21673,52 +21860,50 @@ else
   CONFIG_MYSQLCLIENT="$ac_cv_path_CONFIG_MYSQLCLIENT"
 fi
 
-       if test ! "x${CONFIG_MYSQLCLIENT}" = xNo; then
-           if test x"" = x ; then A=--cflags ; else A="" ; fi
-           MYSQLCLIENT_INCLUDE=$(${CONFIG_MYSQLCLIENT} $A)
-           if test x"" = x ; then A=--libs ; else A="" ; fi
-           MYSQLCLIENT_LIB=$(${CONFIG_MYSQLCLIENT} $A)
-           if test x"" != x ; then
-               saved_cppflags="${CPPFLAGS}"
-               if test "x${MYSQLCLIENT_DIR}" != "x"; then
-                   MYSQLCLIENT_INCLUDE="-I${MYSQLCLIENT_DIR}/include"
-               fi
-               CPPFLAGS="${CPPFLAGS} ${MYSQLCLIENT_INCLUDE}"
+               if test ! "x${CONFIG_MYSQLCLIENT}" = xNo; then
+                       if test x"" = x ; then A=--cflags ; else A="" ; fi
+                       MYSQLCLIENT_INCLUDE=$(${CONFIG_MYSQLCLIENT} $A)
+                       MYSQLCLIENT_INCLUDE=$(echo ${MYSQLCLIENT_INCLUDE} | $SED -e "s|-I|-I${MYSQLCLIENT_DIR}|g")
 
-               saved_libs="${LIBS}"
-               LIBS="${MYSQLCLIENT_LIB}"
+                       if test x"" = x ; then A=--libs ; else A="" ; fi
+                       MYSQLCLIENT_LIB=$(${CONFIG_MYSQLCLIENT} $A)
+                       MYSQLCLIENT_LIB=$(echo ${MYSQLCLIENT_LIB} | $SED -e "s|-L|-L${MYSQLCLIENT_DIR}|g")
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                       if test x"" != x ; then
+                               saved_cppflags="${CPPFLAGS}"
+                               CPPFLAGS="${CPPFLAGS} ${MYSQLCLIENT_INCLUDE}"
+
+                               saved_libs="${LIBS}"
+                               LIBS=${MYSQLCLIENT_LIB}
+
+                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
  ;
-
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-     PBX_MYSQLCLIENT=1
-
+   PBX_MYSQLCLIENT=1
 $as_echo "#define HAVE_MYSQLCLIENT 1" >>confdefs.h
 
-
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-               CPPFLAGS="${saved_cppflags}"
-               LIBS="${saved_libs}"
-           else
-               PBX_MYSQLCLIENT=1
+                               CPPFLAGS="${saved_cppflags}"
+                               LIBS="${saved_libs}"
+                       else
+                               PBX_MYSQLCLIENT=1
 
 $as_echo "#define HAVE_MYSQLCLIENT 1" >>confdefs.h
 
-           fi
+                       fi
+               fi
        fi
-    fi
 
 
 
@@ -21827,9 +22012,9 @@ fi
 
 
 
-    if test "x${PBX_NEON}" != "x1" -a "${USE_NEON}" != "no"; then
-       PBX_NEON=0
-       if test -n "$ac_tool_prefix"; then
+               if test "x${PBX_NEON}" != "x1" -a "${USE_NEON}" != "no"; then
+               PBX_NEON=0
+               if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}neon-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}neon-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -21929,58 +22114,56 @@ else
   CONFIG_NEON="$ac_cv_path_CONFIG_NEON"
 fi
 
-       if test ! "x${CONFIG_NEON}" = xNo; then
-           if test x"" = x ; then A=--cflags ; else A="" ; fi
-           NEON_INCLUDE=$(${CONFIG_NEON} $A)
-           if test x"" = x ; then A=--libs ; else A="" ; fi
-           NEON_LIB=$(${CONFIG_NEON} $A)
-           if test x"" != x ; then
-               saved_cppflags="${CPPFLAGS}"
-               if test "x${NEON_DIR}" != "x"; then
-                   NEON_INCLUDE="-I${NEON_DIR}/include"
-               fi
-               CPPFLAGS="${CPPFLAGS} ${NEON_INCLUDE}"
+               if test ! "x${CONFIG_NEON}" = xNo; then
+                       if test x"" = x ; then A=--cflags ; else A="" ; fi
+                       NEON_INCLUDE=$(${CONFIG_NEON} $A)
+                       NEON_INCLUDE=$(echo ${NEON_INCLUDE} | $SED -e "s|-I|-I${NEON_DIR}|g")
 
-               saved_libs="${LIBS}"
-               LIBS="${NEON_LIB}"
+                       if test x"" = x ; then A=--libs ; else A="" ; fi
+                       NEON_LIB=$(${CONFIG_NEON} $A)
+                       NEON_LIB=$(echo ${NEON_LIB} | $SED -e "s|-L|-L${NEON_DIR}|g")
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                       if test x"" != x ; then
+                               saved_cppflags="${CPPFLAGS}"
+                               CPPFLAGS="${CPPFLAGS} ${NEON_INCLUDE}"
+
+                               saved_libs="${LIBS}"
+                               LIBS=${NEON_LIB}
+
+                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
  ;
-
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-     PBX_NEON=1
-
+   PBX_NEON=1
 $as_echo "#define HAVE_NEON 1" >>confdefs.h
 
-
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-               CPPFLAGS="${saved_cppflags}"
-               LIBS="${saved_libs}"
-           else
-               PBX_NEON=1
+                               CPPFLAGS="${saved_cppflags}"
+                               LIBS="${saved_libs}"
+                       else
+                               PBX_NEON=1
 
 $as_echo "#define HAVE_NEON 1" >>confdefs.h
 
-           fi
+                       fi
+               fi
        fi
-    fi
 
 
 
-    if test "x${PBX_NEON29}" != "x1" -a "${USE_NEON29}" != "no"; then
-       PBX_NEON29=0
-       if test -n "$ac_tool_prefix"; then
+               if test "x${PBX_NEON29}" != "x1" -a "${USE_NEON29}" != "no"; then
+               PBX_NEON29=0
+               if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}neon-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}neon-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -22080,22 +22263,23 @@ else
   CONFIG_NEON29="$ac_cv_path_CONFIG_NEON29"
 fi
 
-       if test ! "x${CONFIG_NEON29}" = xNo; then
-           if test x"" = x ; then A=--cflags ; else A="" ; fi
-           NEON29_INCLUDE=$(${CONFIG_NEON29} $A)
-           if test x"--libs" = x ; then A=--libs ; else A="--libs" ; fi
-           NEON29_LIB=$(${CONFIG_NEON29} $A)
-           if test x"#include <ne_auth.h>" != x ; then
-               saved_cppflags="${CPPFLAGS}"
-               if test "x${NEON29_DIR}" != "x"; then
-                   NEON29_INCLUDE="-I${NEON29_DIR}/include"
-               fi
-               CPPFLAGS="${CPPFLAGS} ${NEON29_INCLUDE}"
+               if test ! "x${CONFIG_NEON29}" = xNo; then
+                       if test x"" = x ; then A=--cflags ; else A="" ; fi
+                       NEON29_INCLUDE=$(${CONFIG_NEON29} $A)
+                       NEON29_INCLUDE=$(echo ${NEON29_INCLUDE} | $SED -e "s|-I|-I${NEON29_DIR}|g")
 
-               saved_libs="${LIBS}"
-               LIBS="${NEON29_LIB}"
+                       if test x"--libs" = x ; then A=--libs ; else A="--libs" ; fi
+                       NEON29_LIB=$(${CONFIG_NEON29} $A)
+                       NEON29_LIB=$(echo ${NEON29_LIB} | $SED -e "s|-L|-L${NEON29_DIR}|g")
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                       if test x"#include <ne_auth.h>" != x ; then
+                               saved_cppflags="${CPPFLAGS}"
+                               CPPFLAGS="${CPPFLAGS} ${NEON29_INCLUDE}"
+
+                               saved_libs="${LIBS}"
+                               LIBS=${NEON29_LIB}
+
+                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
   #include <ne_auth.h>
 int
@@ -22104,36 +22288,33 @@ main ()
  #ifndef NE_AUTH_NTLM
 #error Need libneon >= 0.29.0
 #endif;
-
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-     PBX_NEON29=1
-
+   PBX_NEON29=1
 $as_echo "#define HAVE_NEON29 1" >>confdefs.h
 
-
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-               CPPFLAGS="${saved_cppflags}"
-               LIBS="${saved_libs}"
-           else
-               PBX_NEON29=1
+                               CPPFLAGS="${saved_cppflags}"
+                               LIBS="${saved_libs}"
+                       else
+                               PBX_NEON29=1
 
 $as_echo "#define HAVE_NEON29 1" >>confdefs.h
 
-           fi
+                       fi
+               fi
        fi
-    fi
 
 
 
-    if test "x${PBX_NETSNMP}" != "x1" -a "${USE_NETSNMP}" != "no"; then
-       PBX_NETSNMP=0
-       if test -n "$ac_tool_prefix"; then
+               if test "x${PBX_NETSNMP}" != "x1" -a "${USE_NETSNMP}" != "no"; then
+               PBX_NETSNMP=0
+               if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}net-snmp-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}net-snmp-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -22233,24 +22414,25 @@ else
   CONFIG_NETSNMP="$ac_cv_path_CONFIG_NETSNMP"
 fi
 
-       if test ! "x${CONFIG_NETSNMP}" = xNo; then
-           if test x"" = x ; then A=--cflags ; else A="" ; fi
-           NETSNMP_INCLUDE=$(${CONFIG_NETSNMP} $A)
-           if test x"--agent-libs" = x ; then A=--libs ; else A="--agent-libs" ; fi
-           NETSNMP_LIB=$(${CONFIG_NETSNMP} $A)
-           if test x"#include <net-snmp/net-snmp-config.h>
+               if test ! "x${CONFIG_NETSNMP}" = xNo; then
+                       if test x"" = x ; then A=--cflags ; else A="" ; fi
+                       NETSNMP_INCLUDE=$(${CONFIG_NETSNMP} $A)
+                       NETSNMP_INCLUDE=$(echo ${NETSNMP_INCLUDE} | $SED -e "s|-I|-I${NETSNMP_DIR}|g")
+
+                       if test x"--agent-libs" = x ; then A=--libs ; else A="--agent-libs" ; fi
+                       NETSNMP_LIB=$(${CONFIG_NETSNMP} $A)
+                       NETSNMP_LIB=$(echo ${NETSNMP_LIB} | $SED -e "s|-L|-L${NETSNMP_DIR}|g")
+
+                       if test x"#include <net-snmp/net-snmp-config.h>
 #include <net-snmp/net-snmp-includes.h>
 #include <net-snmp/agent/net-snmp-agent-includes.h>" != x ; then
-               saved_cppflags="${CPPFLAGS}"
-               if test "x${NETSNMP_DIR}" != "x"; then
-                   NETSNMP_INCLUDE="-I${NETSNMP_DIR}/include"
-               fi
-               CPPFLAGS="${CPPFLAGS} ${NETSNMP_INCLUDE}"
+                               saved_cppflags="${CPPFLAGS}"
+                               CPPFLAGS="${CPPFLAGS} ${NETSNMP_INCLUDE}"
 
-               saved_libs="${LIBS}"
-               LIBS="${NETSNMP_LIB}"
+                               saved_libs="${LIBS}"
+                               LIBS=${NETSNMP_LIB}
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
   #include <net-snmp/net-snmp-config.h>
 #include <net-snmp/net-snmp-includes.h>
@@ -22259,30 +22441,27 @@ int
 main ()
 {
  int callback = snmp_register_callback(0, 0, NULL, NULL);
-
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-     PBX_NETSNMP=1
-
+   PBX_NETSNMP=1
 $as_echo "#define HAVE_NETSNMP 1" >>confdefs.h
 
-
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-               CPPFLAGS="${saved_cppflags}"
-               LIBS="${saved_libs}"
-           else
-               PBX_NETSNMP=1
+                               CPPFLAGS="${saved_cppflags}"
+                               LIBS="${saved_libs}"
+                       else
+                               PBX_NETSNMP=1
 
 $as_echo "#define HAVE_NETSNMP 1" >>confdefs.h
 
-           fi
+                       fi
+               fi
        fi
-    fi
 
 
 
@@ -23664,7 +23843,7 @@ if test "x${PBX_PJ_TRANSACTION_GRP_LOCK}" != "x1" -a "${USE_PJ_TRANSACTION_GRP_L
       AST_PJ_TRANSACTION_GRP_LOCK_FOUND=yes
    else
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
-      CFLAGS="${CFLAGS} "
+      CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
       as_ac_Lib=`$as_echo "ac_cv_lib_pjsip_${pbxfuncname}" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpjsip" >&5
 $as_echo_n "checking for ${pbxfuncname} in -lpjsip... " >&6; }
@@ -23672,7 +23851,7 @@ if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpjsip ${pbxlibdir}  $LIBS"
+LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIBS $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 
    # now check for the header.
    if test "${AST_PJ_TRANSACTION_GRP_LOCK_FOUND}" = "yes"; then
-      PJ_TRANSACTION_GRP_LOCK_LIB="${pbxlibdir} -lpjsip "
+      PJ_TRANSACTION_GRP_LOCK_LIB="${pbxlibdir} -lpjsip $PJPROJECT_LIBS"
       # if --with-PJ_TRANSACTION_GRP_LOCK=DIR has been specified, use it.
       if test "x${PJ_TRANSACTION_GRP_LOCK_DIR}" != "x"; then
          PJ_TRANSACTION_GRP_LOCK_INCLUDE="-I${PJ_TRANSACTION_GRP_LOCK_DIR}/include"
       fi
-      PJ_TRANSACTION_GRP_LOCK_INCLUDE="${PJ_TRANSACTION_GRP_LOCK_INCLUDE} "
+      PJ_TRANSACTION_GRP_LOCK_INCLUDE="${PJ_TRANSACTION_GRP_LOCK_INCLUDE} $PJPROJECT_CFLAGS"
       if test "xpjsip.h" = "x" ; then  # no header, assume found
          PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND="1"
       else                             # check for the header
 
 
 
+saved_cppflags="${CPPFLAGS}"
+saved_libs="${LIBS}"
+CPPFLAGS="${CPPFLAGS} ${PJPROJECT_CFLAGS}"
+LIBS="${LIBS} ${PJPROJECT_LIBS}"
 
     if test "x${PBX_PJSIP_REPLACE_MEDIA_STREAM}" != "x1" -a "${USE_PJSIP_REPLACE_MEDIA_STREAM}" != "no"; then
         if test "x" != "x"; then
@@ -23798,6 +23981,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
        CPPFLAGS="${saved_cppflags}"
     fi
 
+LIBS="${saved_libs}"
+CPPFLAGS="${saved_cppflags}"
 
 
 if test "x${PBX_POPT}" != "x1" -a "${USE_POPT}" != "no"; then
 
 
 
+if test "x${PBX_PRI_SETUP_ACK_INBAND}" != "x1" -a "${USE_PRI_SETUP_ACK_INBAND}" != "no"; then
+   pbxlibdir=""
+   # if --with-PRI_SETUP_ACK_INBAND=DIR has been specified, use it.
+   if test "x${PRI_SETUP_ACK_INBAND_DIR}" != "x"; then
+      if test -d ${PRI_SETUP_ACK_INBAND_DIR}/lib; then
+         pbxlibdir="-L${PRI_SETUP_ACK_INBAND_DIR}/lib"
+      else
+         pbxlibdir="-L${PRI_SETUP_ACK_INBAND_DIR}"
+      fi
+   fi
+   pbxfuncname="pri_setup_ack"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_PRI_SETUP_ACK_INBAND_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpri ${pbxlibdir}  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  AST_PRI_SETUP_ACK_INBAND_FOUND=yes
+else
+  AST_PRI_SETUP_ACK_INBAND_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_PRI_SETUP_ACK_INBAND_FOUND}" = "yes"; then
+      PRI_SETUP_ACK_INBAND_LIB="${pbxlibdir} -lpri "
+      # if --with-PRI_SETUP_ACK_INBAND=DIR has been specified, use it.
+      if test "x${PRI_SETUP_ACK_INBAND_DIR}" != "x"; then
+         PRI_SETUP_ACK_INBAND_INCLUDE="-I${PRI_SETUP_ACK_INBAND_DIR}/include"
+      fi
+      PRI_SETUP_ACK_INBAND_INCLUDE="${PRI_SETUP_ACK_INBAND_INCLUDE} "
+      if test "xlibpri.h" = "x" ; then # no header, assume found
+         PRI_SETUP_ACK_INBAND_HEADER_FOUND="1"
+      else                             # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${PRI_SETUP_ACK_INBAND_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
+if test "x$ac_cv_header_libpri_h" = xyes; then :
+  PRI_SETUP_ACK_INBAND_HEADER_FOUND=1
+else
+  PRI_SETUP_ACK_INBAND_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${PRI_SETUP_ACK_INBAND_HEADER_FOUND}" = "x0" ; then
+         PRI_SETUP_ACK_INBAND_LIB=""
+         PRI_SETUP_ACK_INBAND_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+            PRI_SETUP_ACK_INBAND_LIB=""
+         fi
+         PBX_PRI_SETUP_ACK_INBAND=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_PRI_SETUP_ACK_INBAND 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
 if test "x${PBX_PRI_L2_PERSISTENCE}" != "x1" -a "${USE_PRI_L2_PERSISTENCE}" != "no"; then
    pbxlibdir=""
    # if --with-PRI_L2_PERSISTENCE=DIR has been specified, use it.
@@ -26477,7 +26766,7 @@ fi
 
 fi
 
-# Check for libss7 v1.0 branch compatible version.
+# Check for libss7 v2.0 branch compatible version.
 
 if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
    pbxlibdir=""
@@ -26489,7 +26778,7 @@ if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
          pbxlibdir="-L${SS7_DIR}"
       fi
    fi
-   pbxfuncname="ss7_set_adjpc"
+   pbxfuncname="ss7_set_isup_timer"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
       AST_SS7_FOUND=yes
    else
 
 
 
+
+if test "x${PBX_OPUS}" != "x1" -a "${USE_OPUS}" != "no"; then
+   pbxlibdir=""
+   # if --with-OPUS=DIR has been specified, use it.
+   if test "x${OPUS_DIR}" != "x"; then
+      if test -d ${OPUS_DIR}/lib; then
+         pbxlibdir="-L${OPUS_DIR}/lib"
+      else
+         pbxlibdir="-L${OPUS_DIR}"
+      fi
+   fi
+   pbxfuncname="opus_encoder_create"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_OPUS_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      as_ac_Lib=`$as_echo "ac_cv_lib_opus_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lopus" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lopus... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lopus ${pbxlibdir}  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  AST_OPUS_FOUND=yes
+else
+  AST_OPUS_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_OPUS_FOUND}" = "yes"; then
+      OPUS_LIB="${pbxlibdir} -lopus "
+      # if --with-OPUS=DIR has been specified, use it.
+      if test "x${OPUS_DIR}" != "x"; then
+         OPUS_INCLUDE="-I${OPUS_DIR}/include"
+      fi
+      OPUS_INCLUDE="${OPUS_INCLUDE} "
+      if test "xopus/opus.h" = "x" ; then      # no header, assume found
+         OPUS_HEADER_FOUND="1"
+      else                             # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${OPUS_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default"
+if test "x$ac_cv_header_opus_opus_h" = xyes; then :
+  OPUS_HEADER_FOUND=1
+else
+  OPUS_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${OPUS_HEADER_FOUND}" = "x0" ; then
+         OPUS_LIB=""
+         OPUS_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+            OPUS_LIB=""
+         fi
+         PBX_OPUS=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_OPUS 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
 if test "${USE_PWLIB}" != "no"; then
        if test -n "${PWLIB_DIR}"; then
                PWLIBDIR="${PWLIB_DIR}"
 
 fi
 
+if test "$PBX_OPENSSL" = "1";
+then
+
+if test "x${PBX_OPENSSL_EC}" != "x1" -a "${USE_OPENSSL_EC}" != "no"; then
+   pbxlibdir=""
+   # if --with-OPENSSL_EC=DIR has been specified, use it.
+   if test "x${OPENSSL_EC_DIR}" != "x"; then
+      if test -d ${OPENSSL_EC_DIR}/lib; then
+         pbxlibdir="-L${OPENSSL_EC_DIR}/lib"
+      else
+         pbxlibdir="-L${OPENSSL_EC_DIR}"
+      fi
+   fi
+   pbxfuncname="EC_KEY_new_by_curve_name"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_OPENSSL_EC_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      as_ac_Lib=`$as_echo "ac_cv_lib_ssl_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lssl" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lssl... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl ${pbxlibdir} -lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  AST_OPENSSL_EC_FOUND=yes
+else
+  AST_OPENSSL_EC_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_OPENSSL_EC_FOUND}" = "yes"; then
+      OPENSSL_EC_LIB="${pbxlibdir} -lssl -lcrypto"
+      # if --with-OPENSSL_EC=DIR has been specified, use it.
+      if test "x${OPENSSL_EC_DIR}" != "x"; then
+         OPENSSL_EC_INCLUDE="-I${OPENSSL_EC_DIR}/include"
+      fi
+      OPENSSL_EC_INCLUDE="${OPENSSL_EC_INCLUDE} "
+      if test "xopenssl/ec.h" = "x" ; then     # no header, assume found
+         OPENSSL_EC_HEADER_FOUND="1"
+      else                             # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${OPENSSL_EC_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "openssl/ec.h" "ac_cv_header_openssl_ec_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_ec_h" = xyes; then :
+  OPENSSL_EC_HEADER_FOUND=1
+else
+  OPENSSL_EC_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${OPENSSL_EC_HEADER_FOUND}" = "x0" ; then
+         OPENSSL_EC_LIB=""
+         OPENSSL_EC_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+            OPENSSL_EC_LIB=""
+         fi
+         PBX_OPENSSL_EC=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENSSL_EC 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+fi
+
 
 if test "x${PBX_SRTP}" != "x1" -a "${USE_SRTP}" != "no"; then
    pbxlibdir=""
@@ -30542,16 +31044,6 @@ rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
 
-ac_fn_c_check_header_mongrel "$LINENO" "h323.h" "ac_cv_header_h323_h" "$ac_includes_default"
-if test "x$ac_cv_header_h323_h" = xyes; then :
-  PBX_H323=1
-else
-  PBX_H323=0
-fi
-
-
-
-
 ac_fn_c_check_header_mongrel "$LINENO" "linux/compiler.h" "ac_cv_header_linux_compiler_h" "$ac_includes_default"
 if test "x$ac_cv_header_linux_compiler_h" = xyes; then :
 
@@ -30674,9 +31166,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 
-    if test "x${PBX_SDL}" != "x1" -a "${USE_SDL}" != "no"; then
-       PBX_SDL=0
-       if test -n "$ac_tool_prefix"; then
+               if test "x${PBX_SDL}" != "x1" -a "${USE_SDL}" != "no"; then
+               PBX_SDL=0
+               if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}sdl-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}sdl-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -30776,52 +31268,50 @@ else
   CONFIG_SDL="$ac_cv_path_CONFIG_SDL"
 fi
 
-       if test ! "x${CONFIG_SDL}" = xNo; then
-           if test x"" = x ; then A=--cflags ; else A="" ; fi
-           SDL_INCLUDE=$(${CONFIG_SDL} $A)
-           if test x"" = x ; then A=--libs ; else A="" ; fi
-           SDL_LIB=$(${CONFIG_SDL} $A)
-           if test x"" != x ; then
-               saved_cppflags="${CPPFLAGS}"
-               if test "x${SDL_DIR}" != "x"; then
-                   SDL_INCLUDE="-I${SDL_DIR}/include"
-               fi
-               CPPFLAGS="${CPPFLAGS} ${SDL_INCLUDE}"
+               if test ! "x${CONFIG_SDL}" = xNo; then
+                       if test x"" = x ; then A=--cflags ; else A="" ; fi
+                       SDL_INCLUDE=$(${CONFIG_SDL} $A)
+                       SDL_INCLUDE=$(echo ${SDL_INCLUDE} | $SED -e "s|-I|-I${SDL_DIR}|g")
 
-               saved_libs="${LIBS}"
-               LIBS="${SDL_LIB}"
+                       if test x"" = x ; then A=--libs ; else A="" ; fi
+                       SDL_LIB=$(${CONFIG_SDL} $A)
+                       SDL_LIB=$(echo ${SDL_LIB} | $SED -e "s|-L|-L${SDL_DIR}|g")
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                       if test x"" != x ; then
+                               saved_cppflags="${CPPFLAGS}"
+                               CPPFLAGS="${CPPFLAGS} ${SDL_INCLUDE}"
+
+                               saved_libs="${LIBS}"
+                               LIBS=${SDL_LIB}
+
+                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
  ;
-
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-     PBX_SDL=1
-
+   PBX_SDL=1
 $as_echo "#define HAVE_SDL 1" >>confdefs.h
 
-
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-               CPPFLAGS="${saved_cppflags}"
-               LIBS="${saved_libs}"
-           else
-               PBX_SDL=1
+                               CPPFLAGS="${saved_cppflags}"
+                               LIBS="${saved_libs}"
+                       else
+                               PBX_SDL=1
 
 $as_echo "#define HAVE_SDL 1" >>confdefs.h
 
-           fi
+                       fi
+               fi
        fi
-    fi
 
 
 if test "x${PBX_SDL_IMAGE}" != "x1" -a "${USE_SDL_IMAGE}" != "no"; then
@@ -31921,7 +32411,7 @@ else
        touch makeopts.acbak
 fi
 
-ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts channels/h323/Makefile"
+ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts"
 
 
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mandatory modules: ${ac_mandatory_list}" >&5
@@ -32654,7 +33144,6 @@ do
     "include/asterisk/autoconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/asterisk/autoconfig.h" ;;
     "build_tools/menuselect-deps") CONFIG_FILES="$CONFIG_FILES build_tools/menuselect-deps" ;;
     "makeopts") CONFIG_FILES="$CONFIG_FILES makeopts" ;;
-    "channels/h323/Makefile") CONFIG_FILES="$CONFIG_FILES channels/h323/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac