]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5687 this patch adds a debouncer to that info message. if you still have problems...
authorAnthony Minessale <anthm@freeswitch.org>
Sun, 11 Aug 2013 19:57:47 +0000 (00:57 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sun, 11 Aug 2013 19:57:47 +0000 (00:57 +0500)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h

index 50261d7f4ed8a248441ce00fec58033e433e646f..bdee17669ddaec6ec9e6dfac1016fccec096e060 100644 (file)
@@ -1295,12 +1295,18 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
        case SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ:
                {
                        const char *pl = "<media_control><vc_primitive><to_encoder><picture_fast_update/></to_encoder></vc_primitive></media_control>";
+                       time_t now = switch_epoch_time_now(NULL);
 
-                       if (!zstr(msg->string_arg)) {
-                               pl = msg->string_arg;
-                       }
+                       if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 5) {
+
+                               tech_pvt->last_vid_info = now;
 
-                       nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/media_control+xml"), SIPTAG_PAYLOAD_STR(pl), TAG_END());
+                               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;
index 574e211209efb62c0c10bf6e4e671f364f59dbfc..a2f85806b4339d8969ee836494c6fafcb1096b90 100644 (file)
@@ -752,6 +752,7 @@ struct private_object {
        char *respond_phrase;
        int respond_code;
        char *respond_dest;
+       time_t last_vid_info;
 };