From bb04f16bd5c7a52b0ddd18e1dbecc8cd2e2ce739 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 6 Mar 2009 17:45:32 +0000 Subject: [PATCH] FSCORE-263 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12484 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index df591d8df2..0d930de963 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -932,11 +932,19 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi { private_object_t *tech_pvt; char message[128] = ""; + sofia_dtmf_t dtmf_type; tech_pvt = (private_object_t *) switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); - switch (tech_pvt->dtmf_type) { + dtmf_type = tech_pvt->dtmf_type; + + /* We only can send INFO when we have no media */ + if (!tech_pvt->rtp_session || !switch_channel_media_ready(tech_pvt->channel) || switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE)) { + dtmf_type = DTMF_INFO; + } + + switch (dtmf_type) { case DTMF_2833: return switch_rtp_queue_rfc2833(tech_pvt->rtp_session, dtmf); @@ -947,6 +955,7 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi switch_mutex_unlock(tech_pvt->sofia_mutex); break; default: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unhandled DTMF type!\n"); break; }