From 583bd7a8112ae65604bae09dc118d072a8848bb3 Mon Sep 17 00:00:00 2001 From: kapil Date: Thu, 16 Aug 2012 16:42:17 -0400 Subject: [PATCH 1/2] Added debugging to confirm echo_cancel event works --- libs/freetdm/mod_freetdm/tdm.c | 8 ++++++++ .../endpoints/mod_media_gateway/mod_media_gateway.c | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libs/freetdm/mod_freetdm/tdm.c b/libs/freetdm/mod_freetdm/tdm.c index 6c8657a4c9..ed0d00a1c3 100644 --- a/libs/freetdm/mod_freetdm/tdm.c +++ b/libs/freetdm/mod_freetdm/tdm.c @@ -650,6 +650,9 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi ctdm_private_t *tech_pvt = switch_core_session_get_private(session); if (!zstr(command)) { + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FreeTDM received %s command \n",command); + if (!strcasecmp(command, kPREBUFFER_LEN)) { const char *szval = switch_event_get_header(event, kPREBUFFER_LEN); int val = !zstr(szval) ? atoi(szval) : 0; @@ -664,10 +667,15 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi } else if (!strcasecmp(command, kECHOCANCEL)) { const char *szval = switch_event_get_header(event, kECHOCANCEL); int enabled = !!switch_true(szval); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FreeTDM sending echo cancel [%s] command \n",enabled ? "enable" : "disable"); if (FTDM_SUCCESS != ftdm_channel_command(tech_pvt->ftdm_channel, enabled ? FTDM_COMMAND_ENABLE_ECHOCANCEL : FTDM_COMMAND_DISABLE_ECHOCANCEL, NULL)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to %s echo cancellation.\n", enabled ? "enable" : "disable"); } + + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FreeTDM received unknown command [%s] \n",command); } } diff --git a/src/mod/endpoints/mod_media_gateway/mod_media_gateway.c b/src/mod/endpoints/mod_media_gateway/mod_media_gateway.c index bc50ddc165..bcc3d3cdd8 100644 --- a/src/mod/endpoints/mod_media_gateway/mod_media_gateway.c +++ b/src/mod/endpoints/mod_media_gateway/mod_media_gateway.c @@ -39,13 +39,13 @@ SWITCH_STANDARD_APP(mg_notify_function) if (!strcmp(data, "cng")) { mg_send_t38_cng_notify(term->profile, term->name); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CNG notify\n"); - /* Disable echo cancellation */ - mg_term_set_ec(term, 0); + /* Disable echo cancellation */ + mg_term_set_ec(term, 0); } else if (!strcmp(data, "ced")) { - mg_send_t38_ans_notify(term->profile, term->name); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CED notify\n"); - /* Disable echo cancellation */ - mg_term_set_ec(term, 0); + mg_send_t38_ans_notify(term->profile, term->name); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CED notify\n"); + /* Disable echo cancellation */ + mg_term_set_ec(term, 0); } } From f3160f9ecf227cd32d028a1df8117f2d722c7592 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Thu, 16 Aug 2012 19:06:49 -0400 Subject: [PATCH 2/2] freetdm: ss7 - Fix bug where TDM alarms are not delivered when the span is in M2UA mode --- .../src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c index ab74a9830a..fbc74d66cb 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c @@ -423,6 +423,9 @@ static void *ftdm_sangoma_ss7_run(ftdm_thread_t * me, void *obj) /**********************************************************************/ } check_span_oob_events(ftdmspan); + + /* signal the core that sig events are queued for processing */ + ftdm_span_trigger_signals(ftdmspan); } goto ftdm_sangoma_ss7_stop; }