mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-20 10:14:14 +00:00
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:
1 parent
f1bcc387a3
commit
ab99143d5f
3 files changed
+21
-12
No files matched your search
@@ -1167,6 +1167,8 @@ static int activate_audio_rtp(struct private_object *tech_pvt)
|
||||
r = 0;
|
||||
goto end;
|
||||
}
|
||||
tech_pvt->transports[LDL_TPORT_RTP].read_codec.session = tech_pvt->session;
|
||||
|
||||
tech_pvt->transports[LDL_TPORT_RTP].read_frame.rate = tech_pvt->transports[LDL_TPORT_RTP].read_codec.implementation->samples_per_second;
|
||||
tech_pvt->transports[LDL_TPORT_RTP].read_frame.codec = &tech_pvt->transports[LDL_TPORT_RTP].read_codec;
|
||||
|
||||
@@ -1186,6 +1188,7 @@ static int activate_audio_rtp(struct private_object *tech_pvt)
|
||||
r = 0;
|
||||
goto end;
|
||||
}
|
||||
tech_pvt->transports[LDL_TPORT_RTP].write_codec.session = tech_pvt->session;
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Set Write Codec to %s@%d\n",
|
||||
tech_pvt->transports[LDL_TPORT_RTP].codec_name, (int) tech_pvt->transports[LDL_TPORT_RTP].write_codec.implementation->samples_per_second);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user