switch (dtmf_type) {
case DTMF_2833:
{
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Enqueuing RFC2833 DTMF %c of length %d\n", dtmf->digit, dtmf->duration);
return switch_rtp_queue_rfc2833(tech_pvt->rtp_session, dtmf);
}
case DTMF_INFO:
{
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sending INFO DTMF %c of length %d\n", dtmf->digit, dtmf->duration);
snprintf(message, sizeof(message), "Signal=%c\r\nDuration=%d\r\n", dtmf->digit, dtmf->duration / 8);
switch_mutex_lock(tech_pvt->sofia_mutex);
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/dtmf-relay"), SIPTAG_PAYLOAD_STR(message), TAG_END());
}
break;
case DTMF_NONE:
+ {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Discarding DTMF %c of length %d, DTMF type is NONE\n", dtmf->digit, dtmf->duration);
+ }
break;
default:
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Unhandled DTMF type!\n");
}
}
} else {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Disable 2833 dtmf\n");
- switch_channel_set_variable(tech_pvt->channel, "dtmf_type", "none");
- tech_pvt->dtmf_type = DTMF_NONE;
- te = tech_pvt->recv_te = 0;
+ if (tech_pvt->dtmf_type == DTMF_2833) {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Disable 2833 dtmf\n");
+ switch_channel_set_variable(tech_pvt->channel, "dtmf_type", "none");
+ tech_pvt->dtmf_type = DTMF_NONE;
+ te = tech_pvt->recv_te = 0;
+ }
}