summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure123
-rw-r--r--configure.ac3
-rw-r--r--include/asterisk/autoconfig.h.in4
-rw-r--r--res/res_pjsip/pjsip_distributor.c5
4 files changed, 134 insertions, 1 deletions
diff --git a/configure b/configure
index 0dca71fc5..9e414e1e0 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 400385 .
+# From configure.ac Revision: 400770 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for asterisk trunk.
#
@@ -899,6 +899,10 @@ PBX_PORTAUDIO
PORTAUDIO_DIR
PORTAUDIO_INCLUDE
PORTAUDIO_LIB
+PBX_PJ_TRANSACTION_GRP_LOCK
+PJ_TRANSACTION_GRP_LOCK_DIR
+PJ_TRANSACTION_GRP_LOCK_INCLUDE
+PJ_TRANSACTION_GRP_LOCK_LIB
PBX_POPT
POPT_DIR
POPT_INCLUDE
@@ -10151,6 +10155,18 @@ fi
+PJ_TRANSACTION_GRP_LOCK_DESCRIP="PJSIP Transaction Group Lock Support"
+
+PJ_TRANSACTION_GRP_LOCK_DIR=${pjsip_DIR}
+
+PBX_PJ_TRANSACTION_GRP_LOCK=0
+
+
+
+
+
+
+
PORTAUDIO_DESCRIP="PortAudio"
PORTAUDIO_OPTION="portaudio"
PBX_PORTAUDIO=0
@@ -23617,6 +23633,111 @@ fi
+if test "x${PBX_PJ_TRANSACTION_GRP_LOCK}" != "x1" -a "${USE_PJ_TRANSACTION_GRP_LOCK}" != "no"; then
+ pbxlibdir=""
+ # if --with-PJ_TRANSACTION_GRP_LOCK=DIR has been specified, use it.
+ if test "x${PJ_TRANSACTION_GRP_LOCK_DIR}" != "x"; then
+ if test -d ${PJ_TRANSACTION_GRP_LOCK_DIR}/lib; then
+ pbxlibdir="-L${PJ_TRANSACTION_GRP_LOCK_DIR}/lib"
+ else
+ pbxlibdir="-L${PJ_TRANSACTION_GRP_LOCK_DIR}"
+ fi
+ fi
+ pbxfuncname="pjsip_tsx_create_uac2"
+ if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
+ AST_PJ_TRANSACTION_GRP_LOCK_FOUND=yes
+ else
+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+ CFLAGS="${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; }
+if eval \${$as_ac_Lib+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpjsip ${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_PJ_TRANSACTION_GRP_LOCK_FOUND=yes
+else
+ AST_PJ_TRANSACTION_GRP_LOCK_FOUND=no
+fi
+
+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+ fi
+
+ # now check for the header.
+ if test "${AST_PJ_TRANSACTION_GRP_LOCK_FOUND}" = "yes"; then
+ PJ_TRANSACTION_GRP_LOCK_LIB="${pbxlibdir} -lpjsip "
+ # 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} "
+ if test "xpjsip.h" = "x" ; then # no header, assume found
+ PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND="1"
+ else # check for the header
+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} ${PJ_TRANSACTION_GRP_LOCK_INCLUDE}"
+ ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
+if test "x$ac_cv_header_pjsip_h" = xyes; then :
+ PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND=1
+else
+ PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND=0
+fi
+
+
+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+ fi
+ if test "x${PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND}" = "x0" ; then
+ PJ_TRANSACTION_GRP_LOCK_LIB=""
+ PJ_TRANSACTION_GRP_LOCK_INCLUDE=""
+ else
+ if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
+ PJ_TRANSACTION_GRP_LOCK_LIB=""
+ fi
+ PBX_PJ_TRANSACTION_GRP_LOCK=1
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PJ_TRANSACTION_GRP_LOCK 1
+_ACEOF
+
+ fi
+ fi
+fi
+
+
+
+
if test "x${PBX_POPT}" != "x1" -a "${USE_POPT}" != "no"; then
pbxlibdir=""
# if --with-POPT=DIR has been specified, use it.
diff --git a/configure.ac b/configure.ac
index 4ba3b247d..75b13fb9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -433,6 +433,7 @@ AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
AST_EXT_LIB_SETUP([PJPROJECT], [PJPROJECT], [pjproject])
AST_EXT_LIB_SETUP([POPT], [popt], [popt])
+AST_EXT_LIB_SETUP_OPTIONAL([PJ_TRANSACTION_GRP_LOCK], [PJSIP Transaction Group Lock Support], [pjsip])
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_L2_PERSISTENCE], [ISDN Layer 2 persistence option], [PRI], [pri])
@@ -2015,6 +2016,8 @@ fi
AST_PKG_CONFIG_CHECK([PJPROJECT], [libpjproject])
+AST_EXT_LIB_CHECK([PJ_TRANSACTION_GRP_LOCK], [pjsip], [pjsip_tsx_create_uac2], [pjsip.h])
+
AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h])
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index a13df9e9c..31d8efc9a 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -569,6 +569,10 @@
/* Define if your system has the PJPROJECT libraries. */
#undef HAVE_PJPROJECT
+/* Define to 1 if pjsip has the PJSIP Transaction Group Lock Support feature.
+ */
+#undef HAVE_PJ_TRANSACTION_GRP_LOCK
+
/* Define to 1 if your system defines IP_PKTINFO. */
#undef HAVE_PKTINFO
diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c
index 9fd6250e8..5e53cb0fd 100644
--- a/res/res_pjsip/pjsip_distributor.c
+++ b/res/res_pjsip/pjsip_distributor.c
@@ -134,7 +134,12 @@ static pjsip_dialog *find_dialog(pjsip_rx_data *rdata)
}
dlg = pjsip_tsx_get_dlg(tsx);
+
+#ifdef HAVE_PJ_TRANSACTION_GRP_LOCK
+ pj_grp_lock_release(tsx->grp_lock);
+#else
pj_mutex_unlock(tsx->mutex);
+#endif
if (!dlg) {
return NULL;