[Asterisk-code-review] func_channel: allow reading 4 fields from dialplan (asterisk[17])

Sébastien Duthil asteriskteam at digium.com
Thu Apr 2 07:09:47 CDT 2020


Sébastien Duthil has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14082 )


Change subject: func_channel: allow reading 4 fields from dialplan
......................................................................

func_channel: allow reading 4 fields from dialplan

The following fields return an error when read from dialplan:

- exten
- context
- userfield
- channame

ASTERISK-28796 #close

Change-Id: Ieacaac629490f8710fdacc9de80ed5916c5f6ee2
---
M funcs/func_channel.c
1 file changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/14082/1

diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index f82dad3..d143fdc 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -357,13 +357,13 @@
 		locked_copy_string(chan, buf, ast_channel_appl(chan), len);
 	else if (!strcasecmp(data, "appdata") && ast_channel_data(chan))
 		locked_copy_string(chan, buf, ast_channel_data(chan), len);
-	else if (!strcasecmp(data, "exten") && ast_channel_data(chan))
+	else if (!strcasecmp(data, "exten"))
 		locked_copy_string(chan, buf, ast_channel_exten(chan), len);
-	else if (!strcasecmp(data, "context") && ast_channel_data(chan))
+	else if (!strcasecmp(data, "context"))
 		locked_copy_string(chan, buf, ast_channel_context(chan), len);
-	else if (!strcasecmp(data, "userfield") && ast_channel_data(chan))
+	else if (!strcasecmp(data, "userfield"))
 		locked_copy_string(chan, buf, ast_channel_userfield(chan), len);
-	else if (!strcasecmp(data, "channame") && ast_channel_data(chan))
+	else if (!strcasecmp(data, "channame"))
 		locked_copy_string(chan, buf, ast_channel_name(chan), len);
 	else if (!strcasecmp(data, "linkedid")) {
 		ast_channel_lock(chan);

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

Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: Ieacaac629490f8710fdacc9de80ed5916c5f6ee2
Gerrit-Change-Number: 14082
Gerrit-PatchSet: 1
Gerrit-Owner: Sébastien Duthil <sduthil at wazo.community>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200402/10b81dcd/attachment.html>


More information about the asterisk-code-review mailing list