Add echocancelpath configuration option

This commit is contained in:
MelwareDE 2009-04-15 13:39:57 +00:00
parent 79ce55caf4
commit 39f0b5ea1c
4 changed files with 36 additions and 1 deletions

View File

@ -14,6 +14,7 @@ HEAD
- add extension for FAX paper formats and resolutions - add extension for FAX paper formats and resolutions
- adjust NULL PLCI LI path - adjust NULL PLCI LI path
- add resource PLCI - add resource PLCI
- add echocancelpath configuration option
chan_capi-1.1.2 chan_capi-1.1.2

View File

@ -56,6 +56,8 @@ context=isdn-in ;context for incoming calls
;or your files may get choppy. (you can use capicommand(echosquelch|no) for this) ;or your files may get choppy. (you can use capicommand(echosquelch|no) for this)
;echocancel=yes ;Dialogic(R) Diva(R) (CAPI) echo cancellation (yes=g165) ;echocancel=yes ;Dialogic(R) Diva(R) (CAPI) echo cancellation (yes=g165)
;(possible values: 'no', 'yes', 'force', 'g164', 'g165') ;(possible values: 'no', 'yes', 'force', 'g164', 'g165')
;echocancelpath=1;Dialogic(R) Diva(R) (CAPI) echo cancellation path
;(possible values: default '1' - E.1/T.1/S0, '2' - IP, '3' - both)
echocancelold=yes;use facility selector 6 instead of correct 8 (necessary for older eicon drivers) echocancelold=yes;use facility selector 6 instead of correct 8 (necessary for older eicon drivers)
;echotail=64 ;echo cancel tail setting (default=0 for maximum) ;echotail=64 ;echo cancel tail setting (default=0 for maximum)
;echocancelnlp=1 ;activate non-linear-processing; this improves echo cancel ratio, but might ;echocancelnlp=1 ;activate non-linear-processing; this improves echo cancel ratio, but might

View File

@ -556,6 +556,18 @@ static void capi_echo_canceller(struct capi_pvt *i, int function)
ecAvail = 1; ecAvail = 1;
} }
if ((i->channeltype == CAPI_CHANNELTYPE_NULL) &&
(i->line_plci == 0)) {
return;
}
if ((i->channeltype == CAPI_CHANNELTYPE_NULL) && (capi_controllers[i->controller]->ecPath & EC_ECHOCANCEL_PATH_IP) == 0) {
return;
}
if ((i->channeltype != CAPI_CHANNELTYPE_NULL) && (capi_controllers[i->controller]->ecPath & EC_ECHOCANCEL_PATH_IFC) == 0) {
return;
}
/* If echo cancellation is not requested or supported, don't attempt to enable it */ /* If echo cancellation is not requested or supported, don't attempt to enable it */
if (!ecAvail || !i->doEC) { if (!ecAvail || !i->doEC) {
return; return;
@ -779,7 +791,7 @@ static int local_queue_frame(struct capi_pvt *i, struct ast_frame *f)
} }
if (i->writerfd == -1) { if (i->writerfd == -1) {
if (i->resource_plci_type == 0 || i->line_plci == 0 || i->data_plci == 0) { if (i->resource_plci_type == 0 || (i->line_plci == 0 && i->data_plci == 0)) {
cc_log(LOG_ERROR, "No writerfd in local_queue_frame for %s\n", cc_log(LOG_ERROR, "No writerfd in local_queue_frame for %s\n",
i->vname); i->vname);
return -1; return -1;
@ -6435,6 +6447,7 @@ int mkif(struct cc_capi_conf *conf)
} }
capi_controllers[unit]->used = 1; capi_controllers[unit]->used = 1;
capi_controllers[unit]->ecPath = conf->echocancelpath;
tmp->controller = unit; tmp->controller = unit;
tmp->doEC = conf->echocancel; tmp->doEC = conf->echocancel;
@ -7115,6 +7128,8 @@ static int cc_init_capi(void)
cp->broadband = 1; cp->broadband = 1;
} }
cp->ecPath = EC_ECHOCANCEL_PATH_IFC;
#if (CAPI_OS_HINT == 1) #if (CAPI_OS_HINT == 1)
if (profile.dwGlobalOptions & CAPI_PROFILE_ECHO_CANCELLATION) { if (profile.dwGlobalOptions & CAPI_PROFILE_ECHO_CANCELLATION) {
#else #else
@ -7361,6 +7376,13 @@ static int conf_interface(struct cc_capi_conf *conf, struct ast_variable *v)
continue; continue;
} else } else
CONF_TRUE(conf->ecnlp, "echocancelnlp", 1) CONF_TRUE(conf->ecnlp, "echocancelnlp", 1)
if (!strcasecmp(v->name, "echocancelpath")) {
conf->echocancelpath = atoi(v->value);
conf->echocancelpath &= EC_ECHOCANCEL_PATH_BITS;
if (conf->echocancelpath == 0)
conf->echocancelpath = EC_ECHOCANCEL_PATH_BITS;
}
if (!strcasecmp(v->name, "echotail")) { if (!strcasecmp(v->name, "echotail")) {
conf->ectail = atoi(v->value); conf->ectail = atoi(v->value);
if (conf->ectail > 255) { if (conf->ectail > 255) {
@ -7465,6 +7487,7 @@ static int capi_eval_config(struct ast_config *cfg)
conf.ecoption = EC_OPTION_DISABLE_G165; conf.ecoption = EC_OPTION_DISABLE_G165;
conf.ectail = EC_DEFAULT_TAIL; conf.ectail = EC_DEFAULT_TAIL;
conf.ecSelector = FACILITYSELECTOR_ECHO_CANCEL; conf.ecSelector = FACILITYSELECTOR_ECHO_CANCEL;
conf.echocancelpath = EC_ECHOCANCEL_PATH_IFC;
cc_copy_string(conf.name, cat, sizeof(conf.name)); cc_copy_string(conf.name, cat, sizeof(conf.name));
cc_copy_string(conf.language, default_language, sizeof(conf.language)); cc_copy_string(conf.language, default_language, sizeof(conf.language));
#ifdef CC_AST_HAS_VERSION_1_4 #ifdef CC_AST_HAS_VERSION_1_4

View File

@ -193,6 +193,13 @@ typedef struct fax3proto3 B3_PROTO_FAXG3;
#define EC_OPTION_DISABLE_G164_OR_G165 (1<<1 | 1<<2) #define EC_OPTION_DISABLE_G164_OR_G165 (1<<1 | 1<<2)
#define EC_DEFAULT_TAIL 0 /* maximum */ #define EC_DEFAULT_TAIL 0 /* maximum */
/*
EC path mask
*/
#define EC_ECHOCANCEL_PATH_IFC 1 /* Default, activate EC for E.1/T.1/S0 only */
#define EC_ECHOCANCEL_PATH_IP 2 /* Activate EC for IP */
#define EC_ECHOCANCEL_PATH_BITS (EC_ECHOCANCEL_PATH_IFC | EC_ECHOCANCEL_PATH_IP)
#define CC_HOLDTYPE_LOCAL 0 #define CC_HOLDTYPE_LOCAL 0
#define CC_HOLDTYPE_HOLD 1 #define CC_HOLDTYPE_HOLD 1
#define CC_HOLDTYPE_NOTIFY 2 #define CC_HOLDTYPE_NOTIFY 2
@ -557,6 +564,7 @@ struct cc_capi_conf {
struct ast_jb_conf jbconf; struct ast_jb_conf jbconf;
char mohinterpret[MAX_MUSICCLASS]; char mohinterpret[MAX_MUSICCLASS];
#endif #endif
int echocancelpath;
}; };
struct cc_capi_controller { struct cc_capi_controller {
@ -590,6 +598,7 @@ struct cc_capi_controller {
int rtpcodec; int rtpcodec;
int divaExtendedFeaturesAvailable; int divaExtendedFeaturesAvailable;
int ecPath;
}; };