summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-11-25 17:44:30 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-11-25 17:44:30 +0000
commitf9461535d310ff4158346736f83332a5cd7a96d6 (patch)
treeb7360818936be67b9e32d3206387d3cbbda04d56
parent2b9f3b1f60000739ee9dea42bac634c58a4cba5b (diff)
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--main/pbx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/pbx.c b/main/pbx.c
index d765b411e..cf32c7637 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -762,6 +762,7 @@ struct ast_app;
static struct ast_taskprocessor *device_state_tps;
AST_THREADSTORAGE(switch_data);
+AST_THREADSTORAGE(extensionstate_buf);
/*!
\brief ast_exten: An extension
@@ -3707,7 +3708,7 @@ static struct ast_exten *ast_hint_extension(struct ast_channel *c, const char *c
/*! \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 @@ static int ast_extension_state2(struct ast_exten *e)
ast_devstate_aggregate_init(&agg);
- ast_copy_string(hint, ast_get_extension_app(e), sizeof(hint));
+ ast_str_set(&hint, 0, "%s", ast_get_extension_app(e));
- rest = hint; /* One or more devices separated with a & character */
+ rest = hint->str; /* One or more devices separated with a & character */
while ( (cur = strsep(&rest, "&")) )
ast_devstate_aggregate_add(&agg, ast_device_state(cur));