prevent offering vid codec on recover when one was not chosen

This commit is contained in:
Anthony Minessale 2013-04-16 13:40:07 -05:00
parent 22e5203e88
commit 7b93c2d071
1 changed files with 10 additions and 1 deletions

View File

@ -652,6 +652,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch
}
if (sofia_test_flag(tech_pvt, TFLAG_VIDEO)) {
if (!tech_pvt->local_sdp_video_port) {
sofia_glue_tech_choose_video_port(tech_pvt, 0);
}
@ -861,6 +862,7 @@ void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt)
if (codec_string) {
char *tmp_codec_string;
switch_channel_set_variable(tech_pvt->channel, "rtp_use_codec_string", codec_string);
if ((tmp_codec_string = switch_core_session_strdup(tech_pvt->session, codec_string))) {
tech_pvt->codec_order_last = switch_separate_string(tmp_codec_string, ',', tech_pvt->codec_order, SWITCH_MAX_CODECS);
tech_pvt->num_codecs =
@ -875,7 +877,7 @@ void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt)
void sofia_glue_check_video_codecs(private_object_t *tech_pvt)
{
if (tech_pvt->num_codecs && !sofia_test_flag(tech_pvt, TFLAG_VIDEO)) {
if (tech_pvt->num_codecs && !sofia_test_flag(tech_pvt, TFLAG_VIDEO) && !switch_channel_test_flag(tech_pvt->channel, CF_RECOVERING)) {
int i;
tech_pvt->video_count = 0;
for (i = 0; i < tech_pvt->num_codecs; i++) {
@ -5913,6 +5915,13 @@ int sofia_recover_callback(switch_core_session_t *session)
}
}
if ((tmp = switch_channel_get_variable(channel, "rtp_use_codec_string"))) {
char *tmp_codec_string = switch_core_session_strdup(session, tmp);
tech_pvt->codec_order_last = switch_separate_string(tmp_codec_string, ',', tech_pvt->codec_order, SWITCH_MAX_CODECS);
tech_pvt->num_codecs = switch_loadable_module_get_codecs_sorted(tech_pvt->codecs, SWITCH_MAX_CODECS, tech_pvt->codec_order, tech_pvt->codec_order_last);
}
rr = switch_channel_get_variable(channel, "sip_invite_record_route");
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {