From f734891d75d0c8a24ec815aeb8386e3b8646c162 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Fri, 18 Feb 2011 10:51:36 -0500 Subject: [PATCH] freetdm: only set ec call end when the HANGUP state is confirmed --- libs/freetdm/src/ftdm_io.c | 2 -- libs/freetdm/src/ftdm_state.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 260892ada0..504c00f33c 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -2175,8 +2175,6 @@ static ftdm_status_t _ftdm_channel_call_hangup_nl(const char *file, const char * { ftdm_status_t status = FTDM_SUCCESS; - ftdm_set_echocancel_call_end(chan); - if (chan->state != FTDM_CHANNEL_STATE_DOWN) { if (chan->state == FTDM_CHANNEL_STATE_HANGUP) { /* make user's life easier, and just ignore double hangup requests */ diff --git a/libs/freetdm/src/ftdm_state.c b/libs/freetdm/src/ftdm_state.c index de62c0f0e7..9fe2b911dc 100644 --- a/libs/freetdm/src/ftdm_state.c +++ b/libs/freetdm/src/ftdm_state.c @@ -83,6 +83,8 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_complete_state(const char *file, const c msg.channel = fchan; msg.event_id = FTDM_SIGEVENT_DIALING; ftdm_span_send_signal(fchan->span, &msg); + } else if (state == FTDM_CHANNEL_STATE_HANGUP) { + ftdm_set_echocancel_call_end(fchan); } /* MAINTENANCE WARNING