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

N A asteriskteam at digium.com
Wed Dec 21 08:59:27 CST 2022


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


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



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/42/19742/1

diff --git a/main/pbx_app.c b/main/pbx_app.c
index 5879d73..0d74573 100644
--- a/main/pbx_app.c
+++ b/main/pbx_app.c
@@ -519,6 +519,9 @@
 			}
 			res = pbx_exec(chan, app, app_args);
 		}
+		/* Since pbx_exec isn't necessarily going to be called again immediately, manually update
+		 * the channel snapshot so it doesn't contain stale data. */
+		ast_channel_publish_snapshot(chan);
 	}
 	return res;
 }

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I42b6bddc81028abe02a8071aa0f34719fb675803
Gerrit-Change-Number: 19742
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/fa979bf1/attachment.html>


More information about the asterisk-code-review mailing list