Compare commits

...

2 Commits

Author SHA1 Message Date
zhaojiecll 908e5e98e2
Merge 3f106e4b91 into 5cb74797fe 2025-01-17 16:41:39 +00:00
zhaojiecll 3f106e4b91
fix the issue of wrong sample rate of telephone -event when recover happened
If recover happens, fs sends a re-invite with sdp info to re-establish the call. unfortunately,  telephone-event's sample rate comes to zero, so dtmf will not work.
2024-11-20 17:18:22 +08:00
1 changed files with 5 additions and 0 deletions

View File

@ -5829,6 +5829,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
if (best_te) {
smh->mparams->te_rate = best_te_rate;
switch_channel_set_variable_printf(session->channel, "rtp_2833_send_rate", "%d", smh->mparams->te_rate);
if (smh->mparams->dtmf_type == DTMF_AUTO || smh->mparams->dtmf_type == DTMF_2833 ||
switch_channel_test_flag(session->channel, CF_LIBERAL_DTMF)) {
@ -14075,6 +14076,10 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
smh->mparams->recv_te = (switch_payload_t)atoi(tmp);
}
if ((tmp = switch_channel_get_variable(session->channel, "rtp_2833_send_rate"))) {
smh->mparams->te_rate = atoi(tmp);
}
if ((tmp = switch_channel_get_variable(session->channel, "rtp_use_codec_rate"))) {
a_engine->cur_payload_map->rm_rate = atoi(tmp);
a_engine->cur_payload_map->adv_rm_rate = a_engine->cur_payload_map->rm_rate;