SWITCH_DECLARE(switch_status_t) switch_ivr_inband_dtmf_generate_session(switch_core_session_t *session, switch_bool_t read_stream)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
- switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
+ switch_codec_t *read_codec;
switch_media_bug_t *bug;
switch_status_t status;
switch_inband_dtmf_generate_t *pvt;
return status;
}
+ read_codec = switch_core_session_get_read_codec(session);
+
if (!read_codec) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can not install inband dtmf generate. No read codec.!\n");
return SWITCH_STATUS_FALSE;