From: mvcstroomer Date: Fri, 16 Aug 2013 05:33:47 +0000 (+0200) Subject: WIP: chan_lcr support for Asterisk 11.5 X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=commitdiff_plain;h=729893ae61a8c4a9ffbcd4efbfda4fac5713c736 WIP: chan_lcr support for Asterisk 11.5 --- diff --git a/chan_lcr.c b/chan_lcr.c index 9adaa59..95972a9 100644 --- a/chan_lcr.c +++ b/chan_lcr.c @@ -168,9 +168,6 @@ struct ast_channel; #include #include #include -#if ASTERISK_VERSION_NUM < 110000 -#include -#endif #include "extension.h" #include "message.h" #include "callerid.h" @@ -178,6 +175,7 @@ struct ast_channel; #include "cause.h" #include "select.h" #include "options.h" +#include "config.h" #include "chan_lcr.h" CHAN_LCR_STATE // state description structure @@ -1193,6 +1191,10 @@ static void lcr_in_setup(struct chan_call *call, int message_type, union paramet /* configure channel */ #if ASTERISK_VERSION_NUM < 100000 + wat een onzin +#endif + +#if ASTERISK_VERSION_NUM < 100000 ast->nativeformats = (options.law=='a')?AST_FORMAT_ALAW:AST_FORMAT_ULAW; ast->readformat = ast->rawreadformat = ast->nativeformats; ast->writeformat = ast->rawwriteformat = ast->nativeformats; diff --git a/configure.ac b/configure.ac index 1911187..d778c2c 100644 --- a/configure.ac +++ b/configure.ac @@ -133,6 +133,23 @@ if test "x$with_asterisk" = "xyes"; then AST_CFLAGS="-Dast_tone_zone_sound=$ast_tone_zone_sound $ast_1_8_or_higher" AC_SUBST([AST_CFLAGS]) + + AC_CHECK_PROG(ASTERISK, asterisk, executable found,) + if test x"$ASTERISK" = x; then + AC_MSG_ERROR([asterisk executable not found]) + fi + + AC_MSG_CHECKING([for asterisk's version]) + version=`asterisk -V` + pri=`echo $version | sed 's#.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)#\1#' ` + sec=`echo $version | sed 's#.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)#\2#' ` + ter=`echo $version | sed 's#.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)#\3#' ` + numver="$(printf '%02d' "$pri")$(printf '%02d' "$sec")$(printf '%02d' "$ter")" +# if [ $numver -lt 100000 ]; then +# AC_MSG_ERROR([Asterisk version found is too old; x.y.z required]) +# fi + AC_MSG_RESULT([$numver]) + AC_DEFINE_UNQUOTED([ASTERISK_VERSION_NUM], $numver, [Asterisk version found]) fi AM_CONDITIONAL(ENABLE_ASTERISK_CHANNEL_DRIVER, test "x$with_asterisk" == "xyes" )