[asterisk-commits] russell: branch russell/chan_refcount r82515 - /team/russell/chan_refcount/fu...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Sep 16 21:01:58 CDT 2007


Author: russell
Date: Sun Sep 16 21:01:57 2007
New Revision: 82515

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82515
Log:
convert the importvar function

Modified:
    team/russell/chan_refcount/funcs/func_logic.c

Modified: team/russell/chan_refcount/funcs/func_logic.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/funcs/func_logic.c?view=diff&rev=82515&r1=82514&r2=82515
==============================================================================
--- team/russell/chan_refcount/funcs/func_logic.c (original)
+++ team/russell/chan_refcount/funcs/func_logic.c Sun Sep 16 21:01:57 2007
@@ -153,14 +153,14 @@
 	memset(buf, 0, len);
 
 	if (!ast_strlen_zero(args.varname)) {
-		struct ast_channel *chan2 = ast_get_channel_by_name_locked(args.channel);
+		struct ast_channel *chan2 = ast_channel_get_by_name(args.channel);
 		if (chan2) {
 			char *s = alloca(strlen(args.varname) + 4);
-			if (s) {
-				sprintf(s, "${%s}", args.varname);
-				pbx_substitute_variables_helper(chan2, s, buf, len);
-			}
+			sprintf(s, "${%s}", args.varname);
+			ast_channel_lock(chan2);
+			pbx_substitute_variables_helper(chan2, s, buf, len);
 			ast_channel_unlock(chan2);
+			ast_channel_unref(chan2);
 		}
 	}
 	return 0;




More information about the asterisk-commits mailing list