]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
manager.c: Fix FRACK when doing CoreShowChannelMap in DEVMODE
authorGeorge Joseph <gjoseph@sangoma.com>
Thu, 8 Aug 2024 16:57:14 +0000 (10:57 -0600)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 5 Sep 2024 17:05:53 +0000 (17:05 +0000)
If you run an AMI CoreShowChannelMap on a channel that isn't in a
bridge and you're in DEVMODE, you can get a FRACK because the
bridge id is empty.  We now simply return an empty list for that
request.

(cherry picked from commit 0778c95e370b3e193c23f16634d7308fc7bce91f)

main/manager.c

index 0d927985db0c1ddd127c1850d4bede8c881bc124..05e4d4eb69c1645de667ec1e9185935b772ebfcc 100644 (file)
@@ -6850,6 +6850,13 @@ static int action_coreshowchannelmap(struct mansession *s, const struct message
                return 0;
        }
 
+       if (ast_strlen_zero(channel_snapshot->bridge->id)) {
+               astman_send_listack(s, m, "Channel map will follow", "start");
+               astman_send_list_complete_start(s, m, "CoreShowChannelMapComplete", 0);
+               astman_send_list_complete_end(s);
+               return 0;
+       }
+
        bridge_snapshot = ast_bridge_get_snapshot_by_uniqueid(channel_snapshot->bridge->id);
        if (!bridge_snapshot) {
                astman_send_listack(s, m, "Channel map will follow", "start");