From c059649f8f9d812ec284150f410c0a6d0c77b2d7 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 23 Nov 2010 16:27:40 -0500 Subject: [PATCH] freetdm: only notify of released channels when is a voice channel --- libs/freetdm/src/ftdm_io.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 24e54574ae..64233a97ac 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -2349,8 +2349,6 @@ static void close_dtmf_debug(ftdm_channel_t *ftdmchan) static ftdm_status_t ftdm_channel_clear_vars(ftdm_channel_t *ftdmchan); FT_DECLARE(ftdm_status_t) ftdm_channel_done(ftdm_channel_t *ftdmchan) { - ftdm_sigmsg_t sigmsg; - ftdm_assert_return(ftdmchan != NULL, FTDM_FAIL, "Null channel can't be done!\n"); ftdm_mutex_lock(ftdmchan->mutex); @@ -2389,12 +2387,15 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_done(ftdm_channel_t *ftdmchan) ftdm_log(FTDM_LOG_DEBUG, "channel done %u:%u\n", ftdmchan->span_id, ftdmchan->chan_id); - memset(&sigmsg, 0, sizeof(sigmsg)); - sigmsg.span_id = ftdmchan->span_id; - sigmsg.chan_id = ftdmchan->chan_id; - sigmsg.channel = ftdmchan; - sigmsg.event_id = FTDM_SIGEVENT_RELEASED; - ftdm_span_send_signal(ftdmchan->span, &sigmsg); + if (FTDM_IS_VOICE_CHANNEL(ftdmchan)) { + ftdm_sigmsg_t sigmsg; + memset(&sigmsg, 0, sizeof(sigmsg)); + sigmsg.span_id = ftdmchan->span_id; + sigmsg.chan_id = ftdmchan->chan_id; + sigmsg.channel = ftdmchan; + sigmsg.event_id = FTDM_SIGEVENT_RELEASED; + ftdm_span_send_signal(ftdmchan->span, &sigmsg); + } ftdm_mutex_unlock(ftdmchan->mutex);