]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
stasis_bridge.c: Fixed wrong video_mode shown
authorsungtae kim <sungtae@messagebird.com>
Fri, 10 Jul 2020 23:14:53 +0000 (01:14 +0200)
committerKevin Harwell <kharwell@digium.com>
Tue, 11 Aug 2020 22:19:51 +0000 (17:19 -0500)
Currently, if the bridge has created by the ARI, the video_mode
parameter was
not shown in the BridgeCreated event correctly.

Fixed it and added video_mode shown in the 'bridge show <bridge id>'
cli.

ASTERISK-28987

Change-Id: I8c205126724e34c2bdab9380f523eb62478e4295

main/bridge.c
res/res_stasis.c
res/stasis/stasis_bridge.c

index 4798c727081a3920254b7524851909134512eab3..23f682ccea1ccc98bc2a69bc2080272bc4bd92e7 100644 (file)
@@ -5126,6 +5126,7 @@ static char *handle_bridge_show_specific(struct ast_cli_entry *e, int cmd, struc
        ast_cli(a->fd, "Subclass: %s\n", snapshot->subclass);
        ast_cli(a->fd, "Creator: %s\n", snapshot->creator);
        ast_cli(a->fd, "Name: %s\n", snapshot->name);
+       ast_cli(a->fd, "Video-Mode: %s\n", ast_bridge_video_mode_to_string(snapshot->video_mode));
        ast_cli(a->fd, "Video-Source-Id: %s\n", snapshot->video_source_id);
        ast_cli(a->fd, "Num-Channels: %u\n", snapshot->num_channels);
        ast_cli(a->fd, "Num-Active: %u\n", snapshot->num_active);
index 85596589c8d5db7cb372e6fe60f1fa8323f4c002..4850f6af2f0b0cd8985691d988b8636c0ab6590a 100644 (file)
@@ -799,12 +799,12 @@ struct ast_bridge *stasis_app_bridge_create(const char *type, const char *name,
 
        bridge = bridge_stasis_new(capabilities, flags, name, id);
        if (bridge) {
-               ast_bridge_set_talker_src_video_mode(bridge);
                if (!ao2_link(app_bridges, bridge)) {
                        ast_bridge_destroy(bridge, 0);
                        bridge = NULL;
                }
        }
+
        return bridge;
 }
 
index 701cbaea829e0e1e36f0b7474b117405138f7aa1..1b87b48a45923b78590d09f843b1ab1a2356ebd3 100644 (file)
@@ -305,6 +305,11 @@ struct ast_bridge *bridge_stasis_new(uint32_t capabilities, unsigned int flags,
 
        bridge = bridge_alloc(sizeof(struct ast_bridge), &bridge_stasis_v_table);
        bridge = bridge_base_init(bridge, capabilities, flags, "Stasis", name, id);
+       if (!bridge) {
+               return NULL;
+       }
+
+       ast_bridge_set_talker_src_video_mode(bridge);
        bridge = bridge_register(bridge);
 
        return bridge;