<p>Nir Simionovich (GreenfieldTech - Israel) has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6815">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">This commit adds a new beanstalkd functionality to the CDR backend.<br><br>Change-Id: Icf8c7b376e1992d2916fc0b3e7886703edf6ec82<br>---<br>M build_tools/menuselect-deps.in<br>M configure<br>M configure.ac<br>M include/asterisk/autoconfig.h.in<br>M makeopts.in<br>5 files changed, 154 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/15/6815/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/build_tools/menuselect-deps.in b/build_tools/menuselect-deps.in<br>index ec70be0..9629ea5 100644<br>--- a/build_tools/menuselect-deps.in<br>+++ b/build_tools/menuselect-deps.in<br>@@ -1,5 +1,6 @@<br> ALSA=@PBX_ALSA@<br> BLUETOOTH=@PBX_BLUETOOTH@<br>+BEANSTALK=@PBX_BEANSTALK@<br> COROSYNC=@PBX_COROSYNC@<br> CRYPTO=@PBX_CRYPTO@<br> BFD=@PBX_BFD@<br>diff --git a/configure b/configure<br>index 893f107..bc4b03c 100755<br>--- a/configure<br>+++ b/configure<br>@@ -991,6 +991,10 @@<br> PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_DIR<br> PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE<br> PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_LIB<br>+PBX_BEANSTALK<br>+BEANSTALK_DIR<br>+BEANSTALK_INCLUDE<br>+BEANSTALK_LIB<br> PBX_PGSQL<br> PGSQL_DIR<br> PGSQL_INCLUDE<br>@@ -1430,6 +1434,7 @@<br> with_osptk<br> with_oss<br> with_postgres<br>+with_beanstalk<br> with_pjproject<br> with_popt<br> with_portaudio<br>@@ -2182,6 +2187,7 @@<br> --with-osptk=PATH use OSP Toolkit files in PATH<br> --with-oss=PATH use Open Sound System files in PATH<br> --with-postgres=PATH use PostgreSQL files in PATH<br>+ --with-beanstalk=PATH use Beanstalk Job Queue files in PATH<br> --with-pjproject=PATH use PJPROJECT files in PATH<br> --with-popt=PATH use popt files in PATH<br> --with-portaudio=PATH use PortAudio files in PATH<br>@@ -11409,6 +11415,38 @@<br> *)<br> PGSQL_DIR="${withval}"<br> ac_mandatory_list="${ac_mandatory_list} PGSQL"<br>+ ;;<br>+ esac<br>+<br>+fi<br>+<br>+<br>+<br>+<br>+<br>+<br>+<br>+<br>+ BEANSTALK_DESCRIP="Beanstalk Job Queue"<br>+ BEANSTALK_OPTION="beanstalk"<br>+ PBX_BEANSTALK=0<br>+<br>+# Check whether --with-beanstalk was given.<br>+if test "${with_beanstalk+set}" = set; then :<br>+ withval=$with_beanstalk;<br>+ case ${withval} in<br>+ n|no)<br>+ USE_BEANSTALK=no<br>+ # -1 is a magic value used by menuselect to know that the package<br>+ # was disabled, other than 'not found'<br>+ PBX_BEANSTALK=-1<br>+ ;;<br>+ y|ye|yes)<br>+ ac_mandatory_list="${ac_mandatory_list} BEANSTALK"<br>+ ;;<br>+ *)<br>+ BEANSTALK_DIR="${withval}"<br>+ ac_mandatory_list="${ac_mandatory_list} BEANSTALK"<br> ;;<br> esac<br> <br>@@ -25043,6 +25081,111 @@<br> <br> <br> <br>+<br>+if test "x${PBX_BEANSTALK}" != "x1" -a "${USE_BEANSTALK}" != "no"; then<br>+ pbxlibdir=""<br>+ # if --with-BEANSTALK=DIR has been specified, use it.<br>+ if test "x${BEANSTALK_DIR}" != "x"; then<br>+ if test -d ${BEANSTALK_DIR}/lib; then<br>+ pbxlibdir="-L${BEANSTALK_DIR}/lib"<br>+ else<br>+ pbxlibdir="-L${BEANSTALK_DIR}"<br>+ fi<br>+ fi<br>+ pbxfuncname="bs_version"<br>+ if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers<br>+ AST_BEANSTALK_FOUND=yes<br>+ else<br>+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"<br>+ CFLAGS="${CFLAGS} "<br>+ as_ac_Lib=`$as_echo "ac_cv_lib_beanstalk_${pbxfuncname}" | $as_tr_sh`<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lbeanstalk" >&5<br>+$as_echo_n "checking for ${pbxfuncname} in -lbeanstalk... " >&6; }<br>+if eval \${$as_ac_Lib+:} false; then :<br>+ $as_echo_n "(cached) " >&6<br>+else<br>+ ac_check_lib_save_LIBS=$LIBS<br>+LIBS="-lbeanstalk ${pbxlibdir} $LIBS"<br>+cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>+/* end confdefs.h. */<br>+<br>+/* Override any GCC internal prototype to avoid an error.<br>+ Use char because int might match the return type of a GCC<br>+ builtin and then its argument prototype would still apply. */<br>+#ifdef __cplusplus<br>+extern "C"<br>+#endif<br>+char ${pbxfuncname} ();<br>+int<br>+main ()<br>+{<br>+return ${pbxfuncname} ();<br>+ ;<br>+ return 0;<br>+}<br>+_ACEOF<br>+if ac_fn_c_try_link "$LINENO"; then :<br>+ eval "$as_ac_Lib=yes"<br>+else<br>+ eval "$as_ac_Lib=no"<br>+fi<br>+rm -f core conftest.err conftest.$ac_objext \<br>+ conftest$ac_exeext conftest.$ac_ext<br>+LIBS=$ac_check_lib_save_LIBS<br>+fi<br>+eval ac_res=\$$as_ac_Lib<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5<br>+$as_echo "$ac_res" >&6; }<br>+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :<br>+ AST_BEANSTALK_FOUND=yes<br>+else<br>+ AST_BEANSTALK_FOUND=no<br>+fi<br>+<br>+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"<br>+ fi<br>+<br>+ # now check for the header.<br>+ if test "${AST_BEANSTALK_FOUND}" = "yes"; then<br>+ BEANSTALK_LIB="${pbxlibdir} -lbeanstalk "<br>+ # if --with-BEANSTALK=DIR has been specified, use it.<br>+ if test "x${BEANSTALK_DIR}" != "x"; then<br>+ BEANSTALK_INCLUDE="-I${BEANSTALK_DIR}/include"<br>+ fi<br>+ BEANSTALK_INCLUDE="${BEANSTALK_INCLUDE} "<br>+ if test "xbeanstalk.h" = "x" ; then # no header, assume found<br>+ BEANSTALK_HEADER_FOUND="1"<br>+ else # check for the header<br>+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"<br>+ CPPFLAGS="${CPPFLAGS} ${BEANSTALK_INCLUDE}"<br>+ ac_fn_c_check_header_mongrel "$LINENO" "beanstalk.h" "ac_cv_header_beanstalk_h" "$ac_includes_default"<br>+if test "x$ac_cv_header_beanstalk_h" = xyes; then :<br>+ BEANSTALK_HEADER_FOUND=1<br>+else<br>+ BEANSTALK_HEADER_FOUND=0<br>+fi<br>+<br>+<br>+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"<br>+ fi<br>+ if test "x${BEANSTALK_HEADER_FOUND}" = "x0" ; then<br>+ BEANSTALK_LIB=""<br>+ BEANSTALK_INCLUDE=""<br>+ else<br>+ if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library<br>+ BEANSTALK_LIB=""<br>+ fi<br>+ PBX_BEANSTALK=1<br>+ cat >>confdefs.h <<_ACEOF<br>+#define HAVE_BEANSTALK 1<br>+_ACEOF<br>+<br>+ fi<br>+ fi<br>+fi<br>+<br>+<br>+<br> # possible places for oss definitions<br> <br> if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then<br>diff --git a/configure.ac b/configure.ac<br>index e714c54..618ff8d 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -526,6 +526,7 @@<br> AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])<br> AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])<br> AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])<br>+AST_EXT_LIB_SETUP([BEANSTALK], [Beanstalk Job Queue], [beanstalk])<br> <br> if test "x${PBX_PJPROJECT}" != "x1" ; then<br> AST_EXT_LIB_SETUP([PJPROJECT], [PJPROJECT], [pjproject])<br>@@ -2170,6 +2171,9 @@<br> <br> AST_EXT_LIB_CHECK([BLUETOOTH], [bluetooth], [ba2str], [bluetooth/bluetooth.h])<br> <br>+AST_EXT_LIB_CHECK([BEA<br>+NSTALK], [beanstalk], [bs_version], [beanstalk.h])<br>+<br> # possible places for oss definitions<br> AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])<br> AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [sys/soundcard.h])<br>diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in<br>index b9b4e1f..c7a1908 100644<br>--- a/include/asterisk/autoconfig.h.in<br>+++ b/include/asterisk/autoconfig.h.in<br>@@ -115,6 +115,9 @@<br> attribute. */<br> #undef HAVE_ATTRIBUTE_warn_unused_result<br> <br>+/* Define to 1 if you have the Beanstalk Job Queue library. */<br>+#undef HAVE_BEANSTALK<br>+<br> /* Define to 1 if you have the Debug symbol decoding library. */<br> #undef HAVE_BFD<br> <br>diff --git a/makeopts.in b/makeopts.in<br>index 6a1164c..d45740d 100644<br>--- a/makeopts.in<br>+++ b/makeopts.in<br>@@ -383,3 +383,6 @@<br> <br> SNDFILE_INCLUDE=@SNDFILE_INCLUDE@<br> SNDFILE_LIB=@SNDFILE_LIB@<br>+<br>+BEANSTALK_INCLUDE=@BEANSTALK_INCLUDE@<br>+BEANSTALK_LIB=@BEANSTALK_LIB@<br>\ No newline at end of file<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6815">change 6815</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6815"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Icf8c7b376e1992d2916fc0b3e7886703edf6ec82 </div>
<div style="display:none"> Gerrit-Change-Number: 6815 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nir Simionovich (GreenfieldTech - Israel) <nirs@greenfieldtech.net> </div>