FS-7499 FS-7513 try to avoid storm of refreshes in heavy usage

This commit is contained in:
Anthony Minessale authored and Michael Jerris committed 2015-05-28 12:47:29 -05:00
1 parent dc4c38dab5
commit 02cac73d37
2 files changed
+32 -17

No files matched your search

+14 -11
View File
@@ -1295,21 +1295,24 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
#if 1
case SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ:
{
//const char *pl = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<media_control>\n<vc_primitive>\n<to_encoder>\n<picture_fast_update>\n</picture_fast_update>\n</to_encoder>\n</vc_primitive>\n</media_control>";
const char *pl = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<media_control><vc_primitive><to_encoder><picture_fast_update /></to_encoder></vc_primitive></media_control>\n";
time_t now = switch_epoch_time_now(NULL);
const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
if (ua && switch_stristr("polycom", ua)) {
if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 1) {
//const char *pl = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<media_control>\n<vc_primitive>\n<to_encoder>\n<picture_fast_update>\n</picture_fast_update>\n</to_encoder>\n</vc_primitive>\n</media_control>";
const char *pl = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<media_control><vc_primitive><to_encoder><picture_fast_update /></to_encoder></vc_primitive></media_control>\n";
time_t now = switch_epoch_time_now(NULL);
tech_pvt->last_vid_info = now;
if (!zstr(msg->string_arg)) {
pl = msg->string_arg;
if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 1) {
tech_pvt->last_vid_info = now;
if (!zstr(msg->string_arg)) {
pl = msg->string_arg;
}
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/media_control+xml"), SIPTAG_PAYLOAD_STR(pl), TAG_END());
}
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/media_control+xml"), SIPTAG_PAYLOAD_STR(pl), TAG_END());
}
}
break;
#endif