[Asterisk-code-review] pbx_app: Update outdated channel pbx_exec snapshots. (asterisk[master])

N A asteriskteam at digium.com
Wed Dec 21 09:03:06 CST 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19743 )


Change subject: pbx_app: Update outdated channel pbx_exec snapshots.
......................................................................

pbx_app: Update outdated channel pbx_exec snapshots.

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
---
M main/pbx_app.c
1 file changed, 26 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/19743/1

diff --git a/main/pbx_app.c b/main/pbx_app.c
index 5879d73..6726a90 100644
--- a/main/pbx_app.c
+++ b/main/pbx_app.c
@@ -519,6 +519,8 @@
 			}
 			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;
 }

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19743
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I2a5131053aa9d11badbc0ef2ef40b1f83d0af086
Gerrit-Change-Number: 19743
Gerrit-PatchSet: 1
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221221/e59afa1a/attachment.html>


More information about the asterisk-code-review mailing list