From 08bea712d478fbe75ecaee235983eaffba775810 Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Fri, 8 Aug 2008 08:13:29 +0000 Subject: [PATCH] Hopefully fixed better counting of active b-channels. --- CHANGES | 1 + chan_capi.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index ab80d31..5d72b3b 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ HEAD - added config setting 'faxdetecttime' to limit the fax detection for a given amount of seconds. - added config option for subscriber prefix. Some lines may show local calls without area code signaled as subscriber-number. Here the complete prefix including area code must be added. +- better counting of active b-channels. chan_capi-1.1.1 diff --git a/chan_capi.c b/chan_capi.c index 63658af..44eaaa4 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -3406,10 +3406,6 @@ static void capidev_handle_connect_b3_active_indication(_cmsg *CMSG, unsigned in return_on_no_interface("CONNECT_ACTIVE_B3_IND"); - if (i->channeltype != CAPI_CHANNELTYPE_NULL) { - capi_controllers[i->controller]->nfreebchannels--; - } - if (i->state == CAPI_STATE_DISCONNECTING) { cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: CONNECT_B3_ACTIVE_IND during disconnect for NCCI %#x\n", i->vname, NCCI); @@ -3528,6 +3524,10 @@ static void capidev_handle_connect_b3_indication(_cmsg *CMSG, unsigned int PLCI, i->NCCI = NCCI; i->B3count = 0; + if (i->channeltype != CAPI_CHANNELTYPE_NULL) { + capi_controllers[i->controller]->nfreebchannels--; + } + return; } @@ -4049,6 +4049,9 @@ static void capidev_handle_msg(_cmsg *CMSG) if(i == NULL) break; if (wInfo == 0) { i->NCCI = NCCI; + if (i->channeltype != CAPI_CHANNELTYPE_NULL) { + capi_controllers[i->controller]->nfreebchannels--; + } } else { i->isdnstate &= ~(CAPI_ISDN_STATE_B3_UP | CAPI_ISDN_STATE_B3_PEND); }