mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 17:22:21 +00:00
Added debugging to confirm echo_cancel event works
This commit is contained in:
parent
e07d588d10
commit
583bd7a811
@ -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);
|
ctdm_private_t *tech_pvt = switch_core_session_get_private(session);
|
||||||
|
|
||||||
if (!zstr(command)) {
|
if (!zstr(command)) {
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FreeTDM received %s command \n",command);
|
||||||
|
|
||||||
if (!strcasecmp(command, kPREBUFFER_LEN)) {
|
if (!strcasecmp(command, kPREBUFFER_LEN)) {
|
||||||
const char *szval = switch_event_get_header(event, kPREBUFFER_LEN);
|
const char *szval = switch_event_get_header(event, kPREBUFFER_LEN);
|
||||||
int val = !zstr(szval) ? atoi(szval) : 0;
|
int val = !zstr(szval) ? atoi(szval) : 0;
|
||||||
@ -665,9 +668,14 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
|
|||||||
const char *szval = switch_event_get_header(event, kECHOCANCEL);
|
const char *szval = switch_event_get_header(event, kECHOCANCEL);
|
||||||
int enabled = !!switch_true(szval);
|
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)) {
|
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");
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,13 +39,13 @@ SWITCH_STANDARD_APP(mg_notify_function)
|
|||||||
if (!strcmp(data, "cng")) {
|
if (!strcmp(data, "cng")) {
|
||||||
mg_send_t38_cng_notify(term->profile, term->name);
|
mg_send_t38_cng_notify(term->profile, term->name);
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CNG notify\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CNG notify\n");
|
||||||
/* Disable echo cancellation */
|
/* Disable echo cancellation */
|
||||||
mg_term_set_ec(term, 0);
|
mg_term_set_ec(term, 0);
|
||||||
} else if (!strcmp(data, "ced")) {
|
} else if (!strcmp(data, "ced")) {
|
||||||
mg_send_t38_ans_notify(term->profile, term->name);
|
mg_send_t38_ans_notify(term->profile, term->name);
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CED notify\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CED notify\n");
|
||||||
/* Disable echo cancellation */
|
/* Disable echo cancellation */
|
||||||
mg_term_set_ec(term, 0);
|
mg_term_set_ec(term, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user