freetdm: enable ec only upon SIGEVENT_PROGRESS_MEDIA

This commit is contained in:
Moises Silva 2011-01-17 19:15:02 -05:00
parent 6734fe711b
commit f3082c7d75
1 changed files with 7 additions and 2 deletions

View File

@ -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 ... */