提交 0c09642b authored 作者: Anthony Minessale's avatar Anthony Minessale

make rtp timeout 10 times longer than specified value when the call is on hold

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6101 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 2f32d01b
...@@ -342,6 +342,7 @@ struct private_object { ...@@ -342,6 +342,7 @@ struct private_object {
sip_contact_t *contact; sip_contact_t *contact;
uint32_t owner_id; uint32_t owner_id;
uint32_t session_id; uint32_t session_id;
uint32_t max_missed_packets;
/** VIDEO **/ /** VIDEO **/
switch_frame_t video_read_frame; switch_frame_t video_read_frame;
switch_codec_t video_read_codec; switch_codec_t video_read_codec;
......
...@@ -1071,11 +1071,10 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f ...@@ -1071,11 +1071,10 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
} }
if (rtp_timeout_sec) { if (rtp_timeout_sec) {
uint32_t packets; tech_pvt->max_missed_packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_timeout_sec) /
packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_timeout_sec) /
tech_pvt->read_codec.implementation->samples_per_frame; tech_pvt->read_codec.implementation->samples_per_frame;
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, packets); switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets);
} }
if (tech_pvt->te) { if (tech_pvt->te) {
...@@ -1228,6 +1227,9 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t * ...@@ -1228,6 +1227,9 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) { if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
char *stream; char *stream;
switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD); switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
if (tech_pvt->max_missed_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets * 10);
}
if (!(stream = switch_channel_get_variable(tech_pvt->channel, SWITCH_HOLD_MUSIC_VARIABLE))) { if (!(stream = switch_channel_get_variable(tech_pvt->channel, SWITCH_HOLD_MUSIC_VARIABLE))) {
stream = tech_pvt->profile->hold_music; stream = tech_pvt->profile->hold_music;
} }
...@@ -1238,6 +1240,9 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t * ...@@ -1238,6 +1240,9 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
} else { } else {
if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) { if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
switch_channel_clear_flag_partner(tech_pvt->channel, CF_BROADCAST); switch_channel_clear_flag_partner(tech_pvt->channel, CF_BROADCAST);
if (tech_pvt->max_missed_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets);
}
switch_channel_set_flag_partner(tech_pvt->channel, CF_BREAK); switch_channel_set_flag_partner(tech_pvt->channel, CF_BREAK);
switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD); switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论