]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_local: Skip filtering audio formats on removed streams.
authorJoshua C. Colp <jcolp@sangoma.com>
Wed, 28 Apr 2021 12:17:13 +0000 (09:17 -0300)
committerJoshua Colp <jcolp@sangoma.com>
Fri, 30 Apr 2021 14:02:34 +0000 (09:02 -0500)
When a stream topology is provided to chan_local when dialing
it filters the audio formats down. This operation did not skip
streams which were removed (that have no formats) resulting in
calling being aborted.

This change causes such streams to be skipped.

ASTERISK-29407

Change-Id: I1de8b98727cb2d10f4bc287da0b5fdcb381addd6

main/core_local.c

index ef5a4c6d3988bc33f505a12c6c6b74392d5803ff..89d369e0020c9042c25ce196efe3327a07a7fa23 100644 (file)
@@ -967,7 +967,8 @@ static struct ast_channel *local_request_with_stream_topology(const char *type,
 
                stream = ast_stream_topology_get_stream(audio_filtered_topology, i);
 
-               if (ast_stream_get_type(stream) != AST_MEDIA_TYPE_AUDIO) {
+               if (ast_stream_get_type(stream) != AST_MEDIA_TYPE_AUDIO ||
+                       ast_stream_get_state(stream) == AST_STREAM_STATE_REMOVED) {
                        continue;
                }