[Asterisk-code-review] res_agi: Evaluate dialplan functions and variables in age exec Imp... (asterisk[19])

Shloime Rosenblum asteriskteam at digium.com
Wed May 11 15:12:32 CDT 2022


Shloime Rosenblum has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18537 )


Change subject: res_agi:  Evaluate  dialplan functions and variables in age exec  Improve agi exec to evaluate dialplan functions and variables in agi exec this can be usefull to SAYFILES in Playback and Read.   ASTERISK-30058 #close
......................................................................

res_agi:  Evaluate  dialplan functions and variables in age exec  Improve agi exec to evaluate dialplan functions and variables in agi exec this can be usefull to SAYFILES in Playback and Read.   ASTERISK-30058 #close

Change-Id: I669991f540496e7bddd096fec82b52c083036832
---
M res/res_agi.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/37/18537/1

diff --git a/res/res_agi.c b/res/res_agi.c
index 339a15d..6643ba6 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -3121,6 +3121,7 @@
 {
 	int res, workaround;
 	struct ast_app *app_to_exec;
+	struct ast_str *data_with_var;
 
 	if (argc < 2)
 		return RESULT_SHOWUSAGE;
@@ -3133,7 +3134,8 @@
 			ast_set_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_WORKAROUNDS);
 		}
 		ast_channel_unlock(chan);
-		res = pbx_exec(chan, app_to_exec, argc == 2 ? "" : argv[2]);
+		ast_str_substitute_variables(&data_with_var, 0, chan, argv[2]);
+		res = pbx_exec(chan, app_to_exec, argc == 2 ? "" : ast_str_buffer(data_with_var));
 		if (!workaround) {
 			ast_channel_clear_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS);
 		}

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

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: I669991f540496e7bddd096fec82b52c083036832
Gerrit-Change-Number: 18537
Gerrit-PatchSet: 1
Gerrit-Owner: Shloime Rosenblum <shloimerosenblum at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220511/40df6666/attachment.html>


More information about the asterisk-code-review mailing list