[asterisk-commits] qwell: branch qwell/ari_channel_variables r393486 - /team/qwell/ari_channel_v...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 2 15:45:36 CDT 2013


Author: qwell
Date: Tue Jul  2 15:45:35 2013
New Revision: 393486

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393486
Log:
Use ast_func_read2(), so as not to limit the length.

Modified:
    team/qwell/ari_channel_variables/res/stasis/control.c

Modified: team/qwell/ari_channel_variables/res/stasis/control.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/res/stasis/control.c?view=diff&rev=393486&r1=393485&r2=393486
==============================================================================
--- team/qwell/ari_channel_variables/res/stasis/control.c (original)
+++ team/qwell/ari_channel_variables/res/stasis/control.c Tue Jul  2 15:45:35 2013
@@ -210,17 +210,19 @@
 char *stasis_app_control_get_channel_var(struct stasis_app_control *control, const char *variable)
 {
 	SCOPED_CHANNELLOCK(lockvar, control->channel);
-	char *value;
+	char *value = NULL;
 
 	if (variable[strlen(variable) - 1] == ')') {
-		if (!(value = ast_malloc(1024))) {
+		RAII_VAR(struct ast_str *, tmp, ast_str_create(32), ast_free);
+
+		if (!tmp) {
 			return NULL;
 		}
 
-		if (ast_func_read(control->channel, variable, value, 1024)) {
-			ast_free(value);
+		if (ast_func_read2(control->channel, variable, &tmp, 0)) {
 			return NULL;
 		}
+		value = ast_strdup(ast_str_buffer(tmp));
 	} else {
 		value = ast_strdup(pbx_builtin_getvar_helper(control->channel, variable));
 	}




More information about the asterisk-commits mailing list