]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9333 #resolve [Disable video refresh by sip INFO by default]
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 7 Jul 2016 18:39:02 +0000 (13:39 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 7 Jul 2016 18:39:02 +0000 (13:39 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.c

index 6a41f870628444de11f89fc3e93890e5aea04858..b43be77da434ffefe76937ce5042ab01311caf9a 100644 (file)
@@ -1379,25 +1379,21 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                break;
 
        case SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ:
-               if (!switch_channel_test_flag(channel, CF_AVPF)) {
-                       //const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
-                       //if (ua && switch_stristr("polycom", ua)) {
-
-                               //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";
-                               switch_time_t now = switch_micro_time_now();
+               if (!switch_channel_test_flag(channel, CF_AVPF) && switch_true(switch_core_get_variable("sofia_send_info_vid_refresh"))) {
+                       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";
+                       switch_time_t now = switch_micro_time_now();
+                       
+                       if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 500000) {
                                
-                               if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 500000) {
-                                       
-                                       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());
+                               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());
+                       }
+                       
                }
                break;
        case SWITCH_MESSAGE_INDICATE_BROADCAST: