[svn-commits] tilghman: trunk r81335 - /trunk/channels/chan_iax2.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 29 10:21:11 CDT 2007


Author: tilghman
Date: Wed Aug 29 10:21:10 2007
New Revision: 81335

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81335
Log:
Changed one too many variable settings in issue #9315 (closes issue #10592)

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=81335&r1=81334&r2=81335
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Wed Aug 29 10:21:10 2007
@@ -3710,7 +3710,6 @@
 	struct ast_channel *tmp;
 	struct chan_iax2_pvt *i;
 	struct ast_variable *v = NULL;
-	struct ast_datastore *variablestore = NULL;
 
 	if (!(i = iaxs[callno])) {
 		ast_log(LOG_WARNING, "No IAX2 pvt found for callno '%d' !\n", callno);
@@ -3759,29 +3758,8 @@
 
 	/* Set inherited variables */
 	if (i->vars) {
-		AST_LIST_HEAD(, ast_var_t) *varlist;
-		varlist = ast_calloc(1, sizeof(*varlist));
-		variablestore = ast_channel_datastore_alloc(&iax2_variable_datastore_info, NULL);
-		if (variablestore && varlist) {
-			variablestore->data = varlist;
-			variablestore->inheritance = DATASTORE_INHERIT_FOREVER;
-			AST_LIST_HEAD_INIT(varlist);
-			for (v = i->vars ; v ; v = v->next) {
-				struct ast_var_t *newvar = ast_var_assign(v->name, v->value);
-				if (!newvar) {
-					ast_log(LOG_ERROR, "Out of memory\n");
-					break;
-				}
-				AST_LIST_INSERT_TAIL(varlist, newvar, entries);
-			}
-			ast_channel_datastore_add(tmp, variablestore);
-		} else {
-			ast_log(LOG_ERROR, "Out of memory\n");
-			if (variablestore)
-				ast_channel_datastore_free(variablestore);
-			if (varlist)
-				ast_free(varlist);
-		}
+		for (v = i->vars ; v ; v = v->next)
+			pbx_builtin_setvar_helper(tmp, v->name, v->value);
 	}
 
 	if (state != AST_STATE_DOWN) {




More information about the svn-commits mailing list