From c6d777d26a897b086e291eef4fd42e969ed20991 Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Sun, 18 Jun 2006 20:57:56 +0000 Subject: [PATCH] - allow one controller number per specified interface only. --- README | 2 +- capi.conf | 4 ++-- chan_capi.c | 22 ++++++---------------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/README b/README index 0ec2536..996bcd3 100644 --- a/README +++ b/README @@ -49,7 +49,7 @@ This chan_capi version includes: - (Inter)national dialing prefix (for callerid) configurable in capi.conf - CLI command "capi info" shows B channel status of chan_capi - Catch all MSN (incomingmsn=*) -- Some configuration enhancements (msn=123,124,125 and controller=1,2,3,4) +- Some configuration enhancements (msn=123,124,125) - Added accountcode= - Echo squelching (echosquelch=1) - Callgroup support diff --git a/capi.conf b/capi.conf index 6f34b91..69ca614 100644 --- a/capi.conf +++ b/capi.conf @@ -26,7 +26,7 @@ incomingmsn=* ;allow incoming calls to this list of MSNs/DIDs, * = any ;this caller id will be used when dial option 'd' is set. ;controller=0 ;ISDN4BSD default ;controller=7 ;ISDN4BSD USB default -controller=1 ;capi controller number to use +controller=1 ;capi controller number of this interface/port group=1 ;dialout group ;prefix=0 ;set a prefix to calling number on incoming calls softdtmf=on ;enable/disable software dtmf detection, recommended for AVM cards @@ -55,7 +55,7 @@ echocancelold=yes;use facility selector 6 instead of correct 8 (necessary for ol ;language=de ;set language for this device (overwrites default language) ;disallow=all ;RTP codec selection (valid with Eicon DIVA Server only) ;allow=all ;RTP codec selection (valid with Eicon DIVA Server only) -devices=2 ;number of concurrent calls on this controller +devices=2 ;number of concurrent calls (b-channels) on this controller ;(2 makes sense for single BRI, 30/23 for PRI/T1) diff --git a/chan_capi.c b/chan_capi.c index e41993d..06c701f 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -4629,11 +4629,8 @@ int mkif(struct cc_capi_conf *conf) { struct capi_pvt *tmp; int i = 0; - char buffer[CAPI_MAX_STRING]; - char buffer_r[CAPI_MAX_STRING]; - char *buffer_rp = buffer_r; - char *contr; unsigned long contrmap = 0; + u_int16_t unit; for (i = 0; i <= conf->devices; i++) { tmp = malloc(sizeof(struct capi_pvt)); @@ -4663,11 +4660,7 @@ int mkif(struct cc_capi_conf *conf) cc_copy_string(tmp->accountcode, conf->accountcode, sizeof(tmp->accountcode)); cc_copy_string(tmp->language, conf->language, sizeof(tmp->language)); - cc_copy_string(buffer, conf->controllerstr, sizeof(buffer)); - contr = strtok_r(buffer, ",", &buffer_rp); - while (contr != NULL) { - u_int16_t unit = atoi(contr); - + unit = atoi(conf->controllerstr); /* There is no reason not to * allow controller 0 ! * @@ -4682,14 +4675,11 @@ int mkif(struct cc_capi_conf *conf) unit = capi_num_controllers; } - /* always range check user input */ - - if (unit >= CAPI_MAX_CONTROLLERS) - unit = CAPI_MAX_CONTROLLERS - 1; + /* always range check user input */ + if (unit > CAPI_MAX_CONTROLLERS) + unit = CAPI_MAX_CONTROLLERS; - contrmap |= (1 << unit); - contr = strtok_r(NULL, ",", &buffer_rp); - } + contrmap |= (1 << unit); tmp->controllers = contrmap; capi_used_controllers |= contrmap;