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

Friendly Automation asteriskteam at digium.com
Wed Apr 8 09:22:15 CDT 2020


Friendly Automation has submitted this change. ( 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(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



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: 2
Gerrit-Owner: Sébastien Duthil <sduthil at wazo.community>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200408/51901660/attachment-0001.html>


More information about the asterisk-code-review mailing list