[Freeswitch-svn] [commit] r6101 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Wed Oct 31 13:30:50 EDT 2007
Author: anthm
Date: Wed Oct 31 13:30:50 2007
New Revision: 6101
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
Log:
make rtp timeout 10 times longer than specified value when the call is on hold
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Wed Oct 31 13:30:50 2007
@@ -342,6 +342,7 @@
sip_contact_t *contact;
uint32_t owner_id;
uint32_t session_id;
+ uint32_t max_missed_packets;
/** VIDEO **/
switch_frame_t video_read_frame;
switch_codec_t video_read_codec;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Wed Oct 31 13:30:50 2007
@@ -1071,11 +1071,10 @@
}
if (rtp_timeout_sec) {
- uint32_t packets;
- packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_timeout_sec) /
+ tech_pvt->max_missed_packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_timeout_sec) /
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) {
@@ -1228,6 +1227,9 @@
if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
char *stream;
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))) {
stream = tech_pvt->profile->hold_music;
}
@@ -1238,6 +1240,9 @@
} else {
if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
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_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
}
More information about the Freeswitch-svn
mailing list