git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7972 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-03-27 20:36:03 +00:00
parent da72bfb9f6
commit ecece5885f
6 changed files with 25 additions and 13 deletions
-1
View File
@@ -1043,7 +1043,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} else {
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
switch_clear_flag_locked(tech_pvt, TFLAG_LATE_NEGOTIATION);
if (!switch_channel_test_flag(tech_pvt->channel, CF_OUTBOUND)) {
const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
+9 -7
View File
@@ -1961,6 +1961,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
for (map = m->m_rtpmaps; map; map = map->rm_next) {
int32_t i;
uint32_t near_rate = 0;
const switch_codec_implementation_t *mimp = NULL, *near_match = NULL;
const char *rm_encoding;
@@ -2018,8 +2019,9 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
match = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
}
if (match && (map->rm_rate == codec_rate)) {
if (ptime && ptime * 1000 != imp->microseconds_per_frame) {
if (match) {
if ((ptime && ptime * 1000 != imp->microseconds_per_frame) || map->rm_rate != codec_rate) {
near_rate = map->rm_rate;
near_match = imp;
match = 0;
continue;
@@ -2036,8 +2038,8 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
char *prefs[1];
char tmp[80];
int num;
switch_snprintf(tmp, sizeof(tmp), "%s@%uk@%ui", near_match->iananame, near_match->samples_per_second, ptime);
switch_snprintf(tmp, sizeof(tmp), "%s@%uk@%ui", near_match->iananame, near_rate ? near_rate : near_match->samples_per_second, ptime);
prefs[0] = tmp;
num = switch_loadable_module_get_codecs_sorted(search, 1, prefs, 1);
@@ -2047,9 +2049,9 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
} else {
mimp = near_match;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Substituting codec %s@%ums\n",
mimp->iananame, mimp->microseconds_per_frame / 1000);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Substituting codec %s@%ui@%uh\n",
mimp->iananame, mimp->microseconds_per_frame / 1000, mimp->samples_per_second);
match = 1;
}