only put session pointers in when its done from a codec that comes from a session and set it to the right one

This commit is contained in:
Anthony Minessale
2012-10-30 16:56:03 -05:00
parent f1bcc387a3
commit ab99143d5f
3 changed files with 21 additions and 12 deletions
+5
View File
@@ -3037,6 +3037,9 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
tech_pvt->read_codec.session = tech_pvt->session;
if (switch_core_codec_init_with_bitrate(&tech_pvt->write_codec,
tech_pvt->iananame,
@@ -3052,6 +3055,8 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
tech_pvt->write_codec.session = tech_pvt->session;
switch_channel_set_variable(tech_pvt->channel, "sip_use_codec_name", tech_pvt->iananame);
switch_channel_set_variable(tech_pvt->channel, "sip_use_codec_fmtp", tech_pvt->rm_fmtp);
switch_channel_set_variable_printf(tech_pvt->channel, "sip_use_codec_rate", "%d", tech_pvt->rm_rate);