]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
debug all media type
authorSeven Du <dujinfang@gmail.com>
Sun, 15 Dec 2013 03:44:30 +0000 (11:44 +0800)
committerSeven Du <dujinfang@gmail.com>
Sun, 15 Dec 2013 03:44:50 +0000 (11:44 +0800)
src/mod/applications/mod_commands/mod_commands.c

index 7956903c3893b42f92bfb95fdaaa230b039ea33b..864052414941a82afaafe40c11d03c66c5e5b12a 100644 (file)
@@ -3666,7 +3666,7 @@ SWITCH_STANDARD_API(uuid_video_refresh_function)
 }
 
 
-#define DEBUG_MEDIA_SYNTAX "<uuid> <read|write|both|vread|vwrite|vboth> <on|off>"
+#define DEBUG_MEDIA_SYNTAX "<uuid> <read|write|both|vread|vwrite|vboth|all> <on|off>"
 SWITCH_STANDARD_API(uuid_debug_media_function)
 {
        char *mycmd = NULL, *argv[3] = { 0 };
@@ -3690,7 +3690,18 @@ SWITCH_STANDARD_API(uuid_debug_media_function)
                msg.from = __FILE__;
 
                if ((lsession = switch_core_session_locate(argv[0]))) {
+                       if (!strcasecmp(argv[1], "all")) {
+                               msg.string_array_arg[0] = "both";
+                       }
+
+        again:
                        status = switch_core_session_receive_message(lsession, &msg);
+
+                       if (status == SWITCH_STATUS_SUCCESS && !strcasecmp(argv[1], "all") && !strcmp(msg.string_array_arg[0], "both")) {
+                               msg.string_array_arg[0] = "vboth";
+                               goto again;
+                       }
+
                        switch_core_session_rwunlock(lsession);
                }
        }