[asterisk-commits] tilghman: trunk r159162 - /trunk/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 25 11:44:31 CST 2008


Author: tilghman
Date: Tue Nov 25 11:44:30 2008
New Revision: 159162

URL: http://svn.digium.com/view/asterisk?view=rev&rev=159162
Log:
Don't limit the length of the hint at the final step (from ~8100 chars max
(or ~500 chars max on LOW_MEMORY) to 80 chars max).  This will allow more
channels to be used in a single hint.

Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=159162&r1=159161&r2=159162
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Tue Nov 25 11:44:30 2008
@@ -762,6 +762,7 @@
 static struct ast_taskprocessor *device_state_tps;
 
 AST_THREADSTORAGE(switch_data);
+AST_THREADSTORAGE(extensionstate_buf);
 
 /*!
    \brief ast_exten: An extension
@@ -3707,7 +3708,7 @@
 /*! \brief Check state of extension by using hints */
 static int ast_extension_state2(struct ast_exten *e)
 {
-	char hint[AST_MAX_EXTENSION] = "";
+	struct ast_str *hint = ast_str_thread_get(&extensionstate_buf, 16);
 	char *cur, *rest;
 	struct ast_devstate_aggregate agg;
 	enum ast_device_state state;
@@ -3717,9 +3718,9 @@
 
 	ast_devstate_aggregate_init(&agg);
 
-	ast_copy_string(hint, ast_get_extension_app(e), sizeof(hint));
-
-	rest = hint;	/* One or more devices separated with a & character */
+	ast_str_set(&hint, 0, "%s", ast_get_extension_app(e));
+
+	rest = hint->str;	/* One or more devices separated with a & character */
 
 	while ( (cur = strsep(&rest, "&")) )
 		ast_devstate_aggregate_add(&agg, ast_device_state(cur));




More information about the asterisk-commits mailing list