- fixed compatibility with Asterisk version 1.0.7

PR#6
This commit is contained in:
MelwareDE 2006-03-26 15:27:13 +00:00
parent 37298a44ff
commit fb4683f7ca
3 changed files with 16 additions and 1 deletions

View File

@ -33,7 +33,9 @@
#include <asterisk/utils.h>
#include <asterisk/cli.h>
#include <asterisk/causes.h>
#ifndef CC_AST_NO_STRINGS
#include <asterisk/strings.h>
#endif
#ifndef CC_AST_NO_DEVICESTATE
#include <asterisk/devicestate.h>
#endif

View File

@ -82,7 +82,6 @@ static inline unsigned int read_capi_dword(void *m)
#define cc_mutex_lock(x) ast_mutex_lock(x)
#define cc_mutex_unlock(x) ast_mutex_unlock(x)
#define cc_log(x...) ast_log(x)
#define cc_copy_string(dst, src, size) ast_copy_string(dst, src, size)
/*
* definitions for compatibility with older versions of ast*
@ -99,6 +98,12 @@ static inline unsigned int read_capi_dword(void *m)
#define CC_AST_BRIDGED_CHANNEL(x) (x)->bridge
#endif
#ifdef CC_AST_NO_STRINGS
#define cc_copy_string(dst, src, size) strncpy(dst, src, size -1)
#else
#define cc_copy_string(dst, src, size) ast_copy_string(dst, src, size)
#endif
#ifdef CC_AST_HAS_BRIDGE_RESULT
#define CC_BRIDGE_RETURN enum ast_bridge_result
#else

View File

@ -130,6 +130,14 @@ else
echo " * no 'devicestate.h'"
fi
if [ -f "$INCLUDEDIR/strings.h" ]; then
echo "#undef CC_AST_NO_STRINGS" >>$CONFIGFILE
echo " * found 'strings.h'"
else
echo "#define CC_AST_NO_STRINGS" >>$CONFIGFILE
echo " * no 'strings.h'"
fi
if grep -q " Type of channel " $INCLUDEDIR/channel.h; then
echo "#define CC_AST_HAS_TYPE_IN_CHANNEL" >>$CONFIGFILE
echo " * found 'type' in ast_channel"