From f3082c7d75926e77062bc83c0318979e89ad0857 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Mon, 17 Jan 2011 19:15:02 -0500 Subject: [PATCH] freetdm: enable ec only upon SIGEVENT_PROGRESS_MEDIA --- libs/freetdm/src/ftdm_io.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 6bfa37576c..c13fe76447 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -2417,8 +2417,6 @@ static ftdm_status_t _ftdm_channel_call_place_nl(const char *file, const char *f ftdm_assert_return(ftdmchan != NULL, FTDM_FAIL, "null channel"); ftdm_assert_return(ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND), FTDM_FAIL, "Call place, but outbound flag not set\n"); - ftdm_set_echocancel_call_begin(ftdmchan); - if (!ftdmchan->span->outgoing_call) { ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "outgoing_call method not implemented in this span!\n"); status = FTDM_ENOSYS; @@ -5548,6 +5546,13 @@ FT_DECLARE(ftdm_status_t) ftdm_span_send_signal(ftdm_span_t *span, ftdm_sigmsg_t } break; + case FTDM_SIGEVENT_PROGRESS_MEDIA: + { + ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Enabling echo cancellation on progress media\n"); + ftdm_set_echocancel_call_begin(sigmsg->channel); + } + break; + case FTDM_SIGEVENT_STOP: if (!ftdm_test_flag(sigmsg->channel, FTDM_CHANNEL_CALL_STARTED)) { /* this happens for FXS devices which blindly send SIGEVENT_STOP, we should fix it there ... */