app_stream_echo: Don't echo declined streams
authorSean Bright <sean.bright@gmail.com>
Sat, 23 Sep 2017 17:32:26 +0000 (13:32 -0400)
committerSean Bright <sean.bright@gmail.com>
Sat, 23 Sep 2017 17:33:54 +0000 (12:33 -0500)
Discovered while experimenting with Cyber Mega Phone 2K Ultimate Dynamic
Edition after accepting the audio request but declining the video one.

Change-Id: Iaa86d41fccfbc1b559a30ccf740d78a3b5f8a98c

apps/app_stream_echo.c

index 9695dcc..717ed1c 100644 (file)
@@ -249,6 +249,11 @@ static struct ast_stream_topology *stream_echo_topology_alloc(
                        continue;
                }
 
+               if (ast_stream_get_state(stream) == AST_STREAM_STATE_REMOVED) {
+                       /* Don't copy removed/declined streams */
+                       continue;
+               }
+
                do {
                        stream = ast_stream_clone(stream, NULL);