]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pbx_app: Update outdated pbx_exec channel snapshots.
authorNaveen Albert <asterisk@phreaknet.org>
Wed, 21 Dec 2022 15:01:20 +0000 (15:01 +0000)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 3 Jan 2023 13:55:45 +0000 (07:55 -0600)
pbx_exec makes a channel snapshot before executing applications.
This doesn't cause an issue during normal dialplan execution
where pbx_exec is called over and over again in succession.
However, if pbx_exec is called "one off", e.g. using
ast_pbx_exec_application, then a channel snapshot never ends
up getting made after the executed application returns, and
inaccurate snapshot information will linger for a while, causing
"core show channels", etc. to show erroneous info.

This is fixed by manually making a channel snapshot at the end
of ast_pbx_exec_application, since we anticipate that pbx_exec
might not get called again immediately.

ASTERISK-30367 #close

Change-Id: I2a5131053aa9d11badbc0ef2ef40b1f83d0af086

main/pbx_app.c

index 5879d73078e6b1e2bb612387864ad730f4ad9803..6726a900b6fb4e47136bf8bc9713231fbf1a0a71 100644 (file)
@@ -519,6 +519,8 @@ int ast_pbx_exec_application(struct ast_channel *chan, const char *app_name, con
                        }
                        res = pbx_exec(chan, app, app_args);
                }
+               /* Manually make a snapshot now, since pbx_exec won't necessarily get called again immediately. */
+               ast_channel_publish_snapshot(chan);
        }
        return res;
 }