[asterisk-dev] is there a need for disabling Echo Cancelation on a Call with an option or channelvar

Stefan Schmidt sst at sil.at
Thu Jul 8 07:01:10 CDT 2010


Hello,

i am testing 1.6.2.9 for our PSTN gateway which has several PRI lines 
connected on a Sangoma A108D card and i have seen that Dahdi 2.3.0.1 has 
some troubles to detect the CED tone. I´ve allready submitted a patch 
(issue 17596) which works better than without the patch but the CED 
recognition is still not perfect.

My problem is that calls coming from my faxserver (asterisk 1.2.40, with 
iaxmodems and hylafax) are often not recognized as fax and the Echo 
cancelation is not turned off. Cause of this i thought about writing a 
patch to set an Option, or Channelvar to disable Echo Canceler when the 
call is answered not when the CED tone is detected. So i just can set 
this Channelvar on each call coming from faxserver and the echo canceler 
is disabled.

My question is if there is some need for this solution or is there a 
better way to solve it then i´ve done?

how i have done this for testing:

extensions.conf

[fromfaxserver]
...
exten => _X.,n,Set(_FAXSERVER=1)
exten => _X.,n,Dial(DAHDI/${EXTEN},120)

patch of channels/chan_dahdi.c
Row: 13392
} else if (pri->pvts[chanpos]->confirmanswer) {
ast_debug(1, "Waiting on answer confirmation on channel %d!\n", 
pri->pvts[chanpos]->channel);
} else {
pri->pvts[chanpos]->dialing = 0;
pri->pvts[chanpos]->subs[SUB_REAL].needanswer =1;
/* Enable echo cancellation if it's not on already */
+ struct ast_channel *owner = pri->pvts[chanpos]->owner;
+ ast_mutex_unlock(&pri->pvts[chanpos]->lock);
+ if(pbx_builtin_getvar_helper(owner, "FAXSERVER")!=NULL) {
+ ast_mutex_lock(&pri->pvts[chanpos]->lock);
+ dahdi_disable_ec(pri->pvts[chanpos]);
+ } else {
+ ast_mutex_lock(&pri->pvts[chanpos]->lock);
+ dahdi_enable_ec(pri->pvts[chanpos]);
+ }
}

#ifdef SUPPORT_USERUSER

best regards

Steve



More information about the asterisk-dev mailing list