[-]
[+]
|
Changed |
chan_capi-HEAD.tar.bz2/CHANGES
|
@@ -3,6 +3,14 @@
HEAD
------------------
+- refuse to reload on active channels
+- ast_devstate_changed() changes with new cache argument
+- check for bchannel information element on incoming call
+
+
+chan_capi-1.1.6
+------------------
+- Asterisk 1.8 changes
- added dialplan variables ISDNPI1 and ISDNPI2
- Support for 'divastreaming' available (Diva 4PRI PCI, Diva 2PRI PCI,
Diva 4PRI HS PCIe, Diva 2PRI HS PCIe, Diva 1PRI HS PCIe,
|
[-]
[+]
|
Changed |
chan_capi-HEAD.tar.bz2/Makefile
^
|
@@ -111,6 +111,7 @@
CFLAGS=-pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
CFLAGS+=$(OPTIMIZE)
+CFLAGS+=-Wno-unused-but-set-variable
CFLAGS+=-O2
CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
CFLAGS+=$(shell if uname -m | grep -q "ppc\|arm\|s390"; then echo "-fsigned-char"; fi)
|
[-]
[+]
|
Changed |
chan_capi-HEAD.tar.bz2/chan_capi.c
^
|
@@ -61,7 +61,7 @@
#include "divaverbose.h"
/* #define CC_VERSION "x.y.z" */
-#define CC_VERSION "$Revision: 947 $"
+#define CC_VERSION "$Revision: 958 $"
/*
* personal stuff
@@ -216,7 +216,7 @@
#endif
/* local prototypes */
-#define CC_B_INTERFACE_NOT_FREE(__x__) (((__x__)->used) || \
+#define CC_B_INTERFACE_NOT_FREE(__x__) (((__x__)->used) || ((__x__)->reserved) || \
((__x__)->channeltype != CAPI_CHANNELTYPE_B) || \
(capi_controllers[(__x__)->controller]->nfreebchannels < capi_controllers[(__x__)->controller]->nfreebchannelsHardThr))
@@ -1212,6 +1212,7 @@
i->peer = NULL;
i->owner = NULL;
i->used = NULL;
+ i->reserved = 0;
if (i->channeltype == CAPI_CHANNELTYPE_NULL) {
capi_interface_task(i, CAPI_INTERFACE_TASK_NULLIFREMOVE);
@@ -2365,6 +2366,9 @@
#else
tmp = ast_channel_alloc(0);
#endif
+
+ cc_mutex_lock(&iflock);
+ i->reserved = 0;
if (tmp == NULL) {
cc_log(LOG_ERROR, "Unable to allocate channel!\n");
@@ -2660,6 +2664,8 @@
found_best_channel:
/* when we come here, we found a free controller match */
cc_copy_string(i->dnid, dest, sizeof(i->dnid));
+ i->reserved = 1;
+ cc_mutex_unlock(&iflock);
tmp = capi_new(i, AST_STATE_RESERVED,
#ifdef CC_AST_HAS_REQUEST_REQUESTOR
requestor ? requestor->linkedid : NULL
@@ -5351,12 +5357,19 @@
if (CONNECT_IND_BCHANNELINFORMATION(CMSG) && (CONNECT_IND_BCHANNELINFORMATION(CMSG)[0] > 0)) {
bchannelinfo[0] = CONNECT_IND_BCHANNELINFORMATION(CMSG)[1] + '0';
+ if ((bchannelinfo[0] == '4') && (CONNECT_IND_BCHANNELINFORMATION(CMSG)[0] >= 4) && (CONNECT_IND_BCHANNELINFORMATION(CMSG)[3] > 0)) {
+ if (CONNECT_IND_BCHANNELINFORMATION(CMSG)[4] & 4) {
+ bchannelinfo[0] = '1';
+ } else {
+ bchannelinfo[0] = '0';
+ }
+ }
}
/* well...somebody is calling us. let's set up a channel */
cc_mutex_lock(&iflock);
for (i = capi_iflist; i; i = i->next) {
- if (i->used) {
+ if (i->used || i->reserved) {
/* is already used */
continue;
}
@@ -5413,6 +5426,8 @@
i->MessageNumber = HEADER_MSGNUM(CMSG);
i->cid_ton = callernplan;
+ i->reserved = 1;
+ cc_mutex_unlock(&iflock);
capi_new(i, AST_STATE_DOWN, NULL);
if (i->isdnmode == CAPI_ISDNMODE_DID) {
i->state = CAPI_STATE_DID;
@@ -6482,10 +6497,10 @@
}
if (ast_true(param)) {
- i->divaDataStubAudioFlags |= 0x0080;
+ i->divaDataStubAudioFlags |= 0x0080 /* Use to activate in Tx direction 0x0040 */;
capi_diva_audio_features(i, 0);
} else if (ast_false(param)) {
- i->divaDataStubAudioFlags &= ~0x0080;
+ i->divaDataStubAudioFlags &= ~0x0080 /* Use to activate in Tx direction ~0x0040 */;
capi_diva_audio_features(i, 0);
} else {
cc_log(LOG_WARNING, "Parameter for noise suppressor invalid.\n");
@@ -9013,12 +9028,16 @@
#ifdef CC_AST_HAS_VERSION_1_4
static int reload(void)
{
- int ret;
+ int ret = 0;
- cc_verbose(1, 0, VERBOSE_PREFIX_1 "config reload\n");
+ if (usecnt) {
+ cc_verbose(1, 0, VERBOSE_PREFIX_1 "chan_capi refused reload because of active channels\n");
+ } else {
+ cc_verbose(1, 0, VERBOSE_PREFIX_1 "chan_capi reload\n");
- unload_module();
- ret = load_module();
+ unload_module();
+ ret = load_module();
+ }
return ret;
}
|
[-]
[+]
|
Changed |
chan_capi-HEAD.tar.bz2/chan_capi.h
^
|
@@ -393,6 +393,8 @@
struct ast_channel *owner;
/*! Channel who called us, possibly NULL */
struct ast_channel *peer;
+ /*! Set if structure is reserved */
+ volatile int reserved;
/* capi message number */
_cword MessageNumber;
|
[-]
[+]
|
Changed |
chan_capi-HEAD.tar.bz2/chan_capi_devstate.c
^
|
@@ -113,7 +113,11 @@
{
if (capiChatProviderRegistered != 0) {
#ifdef CC_AST_HAS_VERSION_1_6
- ast_devstate_changed((inUse != 0) ? AST_DEVICE_INUSE : AST_DEVICE_NOT_INUSE, "capichat:%s", roomName);
+ ast_devstate_changed((inUse != 0) ? AST_DEVICE_INUSE : AST_DEVICE_NOT_INUSE,
+#ifdef CC_AST_HAS_AST_DEVSTATE_CACHE
+ AST_DEVSTATE_CACHABLE,
+#endif
+ "capichat:%s", roomName);
#else
ast_device_state_changed("capichat:%s", roomName);
#endif
@@ -130,7 +134,11 @@
((capiController->nfreebchannels >= capiController->nfreebchannelsHardThr) &&
(capiController->nfreebchannels - channelsChanged < capiController->nfreebchannelsHardThr))) {
#ifdef CC_AST_HAS_VERSION_1_6
- ast_devstate_changed(AST_DEVICE_UNKNOWN, CC_MESSAGE_BIGNAME"/I%d/congestion", capiController->controller);
+ ast_devstate_changed(AST_DEVICE_UNKNOWN,
+#ifdef CC_AST_HAS_AST_DEVSTATE_CACHE
+ AST_DEVSTATE_CACHABLE,
+#endif
+ CC_MESSAGE_BIGNAME"/I%d/congestion", capiController->controller);
#else
ast_device_state_changed (CC_MESSAGE_BIGNAME"/I%d/congestion", capiController->controller);
#endif
|
[-]
[+]
|
Changed |
chan_capi-HEAD.tar.bz2/create_config.sh
^
|
@@ -31,8 +31,15 @@
AVERSION=`sed -n '/.*ASTERISK_VERSION /s/^.*ASTERISK_VERSION //p' $INCLUDEDIR/version.h`
AVERSION=`echo $AVERSION | sed 's/\"//g'`
if [ "$AVERSION" = "" ]; then
- AVERSION="trunk"
- VER="1_6"
+ grep "Do not include" $INCLUDEDIR/version.h >/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ AVERSION="11.0"
+ VER="11_0"
+ AVERSIONNUM=110
+ else
+ AVERSION="trunk"
+ VER="1_6"
+ fi
fi
if [ -z "$AVERSIONNUM" ]; then
AVERSIONNUM=999999
@@ -50,7 +57,16 @@
echo >>$CONFIGFILE
case "$AVERSIONNUM" in
- 1000*)
+ 110*)
+ echo "#define CC_AST_HAS_VERSION_1_6" >>$CONFIGFILE
+ echo "#define CC_AST_HAS_VERSION_1_8" >>$CONFIGFILE
+ echo "#define CC_AST_HAS_VERSION_10_0" >>$CONFIGFILE
+ echo "#define CC_AST_HAS_VERSION_11_0" >>$CONFIGFILE
+ echo "#define CC_AST_HAS_EVENT_MWI" >>$CONFIGFILE
+ echo " * found Asterisk version 11"
+ VER=11_0
+ ;;
+ 100*)
echo "#define CC_AST_HAS_VERSION_1_6" >>$CONFIGFILE
echo "#define CC_AST_HAS_VERSION_1_8" >>$CONFIGFILE
echo "#define CC_AST_HAS_VERSION_10_0" >>$CONFIGFILE
@@ -205,6 +221,13 @@
echo "#undef CC_AST_HAS_AST_DEVSTATE2STR" >>$CONFIGFILE
echo " * obsolete devstate2str function"
fi
+ if grep -q "ast_devstate_changed.*ast_devstate_cache" $INCLUDEDIR/devicestate.h; then
+ echo "#define CC_AST_HAS_AST_DEVSTATE_CACHE" >>$CONFIGFILE
+ echo " * found ast_devstate_cache in ast_devstate_changed function"
+ else
+ echo "#undef CC_AST_HAS_AST_DEVSTATE_CACHE" >>$CONFIGFILE
+ echo " * no ast_devstate_cache in ast_devstate_changed function"
+ fi
if grep -q "ast_request.*requestor" $INCLUDEDIR/channel.h; then
echo "#define CC_AST_HAS_REQUEST_REQUESTOR" >>$CONFIGFILE
echo " * found requestor in ast_request"
@@ -283,6 +306,10 @@
echo "Using Asterisk 10.0 API"
check_version_onesix
;;
+ 11_0)
+ echo "Using Asterisk 11.0 API"
+ check_version_onesix
+ ;;
*)
echo >&2 "Asterisk version invalid."
exit 1
|