[Freeswitch-users] FreeTDM and DAHDI+OSLEC/MG2 anyone?

Tony Tin tony.tin at noahmedia.com.hk
Mon Jun 28 23:29:48 PDT 2010


Hi,

I'm using openzap and libpri. I patched the "ozmod_zt.c" in the same way and
the same problem which is also applied to openzap is fixed. Will anyone
update the openzap source ?

Regards,
Tony



On Tue, Jun 29, 2010 at 8:51 AM, Jeroen C. van Gelderen <
jeroeng at thegreek.com> wrote:

>  Hi Moises,
>
>
>
> I can confirm that the following patch solves the problem:
>
>
>
> [root at elastix freeswitch]# git diff
>
> diff --git a/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c
> b/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c
>
> index a2eacac..b4a3acf 100644
>
> --- a/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c
>
> +++ b/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c
>
> @@ -639,8 +639,9 @@ static FIO_OPEN_FUNCTION(zt_open)
>
>                         }
>
>                         if (ioctl(ftdmchan->sockfd, codes.ECHOCANCEL,
> &len)) {
>
>                                 ftdm_log(FTDM_LOG_WARNING, "Echo cancel not
> available for %d:%d\n", ftdmchan->span_id, ftdmchan->chan_id);
>
> -                       } else if (zt_globals.etlevel >= 0) {
>
> +                       } else if (zt_globals.etlevel > 0) {
>
>                                 len = zt_globals.etlevel;
>
> +                               ftdm_log(FTDM_LOG_INFO, "Enabling echo
> training %d:%d\n", ftdmchan->span_id, ftdmchan->chan_id);
>
>                                 if (ioctl(ftdmchan->sockfd,
> codes.ECHOTRAIN, &len)) {
>
>                                         ftdm_log(FTDM_LOG_WARNING, "Echo
> training not available for %d:%d\n", ftdmchan->span_id, ftdmchan->chan_id);
>
>                                 }
>
> [root at elastix freeswitch]#
>
>
>
> Cheers,
> -Slim
> --
> Jeroen C. "Slim" van Gelderen
> Olympic Sports Data Services
> Email: jeroeng at thegreek.com
> Phone: +1 876 953 6182 x128
>   ------------------------------
>
> *From:* freeswitch-users-bounces at lists.freeswitch.org [mailto:
> freeswitch-users-bounces at lists.freeswitch.org] *On Behalf Of *Jeroen C.
> van Gelderen
> *Sent:* Monday, June 28, 2010 19:20
>
> *To:* freeswitch-users at lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users] FreeTDM and DAHDI+OSLEC/MG2 anyone?
>
>
>
> Hi Moises,
>
>
>
> I basically arrived at the same conclusion about echo training ioctl and I
> commented out the ECHOTRAIN ioctl in FreeTDM. FreeSwitch does indeed pass
> audio if the ECHOTRAIN ioctl does NOT get called..
>
> Cheers,
> -Slim
> --
> Jeroen C. "Slim" van Gelderen
> Olympic Sports Data Services
> Email: jeroeng at thegreek.com
> Phone: +1 876 953 6182 x128
>   ------------------------------
>
> *From:* freeswitch-users-bounces at lists.freeswitch.org [mailto:
> freeswitch-users-bounces at lists.freeswitch.org] *On Behalf Of *Moises Silva
> *Sent:* Monday, June 28, 2010 17:46
> *To:* freeswitch-users at lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users] FreeTDM and DAHDI+OSLEC/MG2 anyone?
>
>
>
> That is what echo_train_level in zt.conf is used for. I wonder if we should
> not be calling the echo train ioctl when is 0, may be the sole fact of
> calling the echo train ioctl is screwing things up.
>
> Try going to src/ftmod/ftmod_zt/ftmod_zt.c around line 642 and comment the
>
> if (ioctl(ftdmchan->sockfd, codes.ECHOTRAIN, &len)) {
> }
>
> the whole if block should be commented, you can use #if 0 #endif, or
> regular C comments.
>
> I took a look at the dahdi drivers and it seems even when this setting is
> 0, then set the state to ECHO_MODE_PRETRAINING, and that can be what OSLEC
> does not like at all.
>
> Moises Silva
> Senior Software Engineer
> Sangoma Technologies Inc. | 50 McIntosh Drive, Suite 120, Markham ON L3R
> 9T3 Canada
> t.. 1 905 474 1990 x 128 | e. moy at sangoma.com
>
> On Mon, Jun 28, 2010 at 4:01 PM, Jeroen C. van Gelderen <
> jeroeng at thegreek.com> wrote:
>
> Hi Moises,
>
> Thank you. This is very helpful as it seems to detail the same problem. I
> tested with both OpenZap and FreeTDM yielding the same results.
>
> I think Anthony Minnessale is close when he writes:
>
> "Maybe there are some new ioctls or something
>  they added for interop with OSLEC that we don't
>  know about."
>
> Except that whatever changed in (the) DAHDI (API) seems to have broken all
> echo canceling (MG2 and OSLEC) somewhere between DAHDI and FreeTDM/OpenZap.
>
> Anthony also suggests:
>
> "If you still have the problem the next step
>  would be to add some debugging code to the
>  ozmod_zt read and write functions to see if
>  it's sending data up to the app."
>
> I'm going to see if my C-fu is up to doing that. Anybody know where the
> debugging code should go for FreeTDM?
>
> Lastly, the only semi-relevant Google find I did was this [1]:
>
> "Make sure echotraining is disabled when using
>  Oslec - this is not supported and if enabled
>  will cause the channel to be silent (i.e. no
>  audio will pass through)"
>
> In FreeTDM/OpenZap/FreeSwitch there doesn't seem to be an "echo training"
> knob to twiddle.
>
> Cheers,
> -Slim
>
> [1] http://www.rowetel.com/ucasterisk/oslec.html
>
>
> --
> Jeroen C. "Slim" van Gelderen
> Olympic Sports Data Services
> Email: jeroeng at thegreek.com
> Phone: +1 876 953 6182 x128
>
> ________________________________________
>
> From: freeswitch-users-bounces at lists.freeswitch.org
>
> [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Moises
> Silva
> Sent: Monday, June 28, 2010 10:04
>
> To: freeswitch-users at lists.freeswitch.org
> Subject: Re: [Freeswitch-users] FreeTDM and DAHDI+OSLEC/MG2 anyone?
>
> This may be of help:
>
>
> http://lists.freeswitch.org/pipermail/freeswitch-users/2010-March/055505.htm
> l
>
> Moises Silva
> Senior Software Engineer
> Sangoma Technologies Inc. | 50 McIntosh Drive, Suite 120, Markham ON L3R
> 9T3
> Canada
> t. 1 905 474 1990 x 128 | e. moy at sangoma..com <moy at sangoma.com>
>
>
> On Sat, Jun 26, 2010 at 8:57 PM, Jeroen C. van Gelderen
> <jeroeng at thegreek.com> wrote:
> Hi everybody,
>
> I have a feeling I must be missing the obvious...
>
> I've been trying to get echo canceling to work with
> Freeswitch/FreeTDM/DAHDI
> but I have been failing miserably for days. When I enable echo cancellation
> (MG2 or OSLEC) on a DAHDI/FreeTDM channel (FXS or FXO) that channel goes
> silent.
>
> In absence of better suggestions I was hoping to replicate someone's "known
> working" configuration. Is anyone successfully running the following
> combination:
>
> - any x86 hardware
> - any recent flavor Linux
> - any recent version of DAHDI using FXO ports
> - FreeSwitch/FreeTDM trunk from git
> - OSLEC echo canceller (or MG2)
> - (BONUS:) Xorcom Astribank with FXO/FXS ports.
>
> I addition to much Googling I've tried most permutations of:
> - CentOS 5.4, 5.5, Ubuntu 10.04 LTS, Elastix
> - x86 and x64 single and multicore CPUs.
> - Non-PAE kernels for 32-bit installs.
> - DADHI from SVN (or -in case of Elastix- the built-in 2.2.0.2)
> - MG2 and OSLEC echo cancellers
> - Freeswitch from Git trunk
>
> In each case everything configures fine to the point that Asterisk 1.6 will
> function with echo cancellation enabled. So we know that DAHDI layer works.
> But Freeswitch channels go silent when echo cancellation is enabled.
>
> Puzzled,
> -Slim
>
> --
> Jeroen C. "Slim" van Gelderen
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100629/2f4f0235/attachment.html 


More information about the FreeSWITCH-users mailing list