[asterisk-commits] murf: branch murf/fast-ast r44923 -
/team/murf/fast-ast/main/pbx.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Oct 12 06:20:02 MST 2006
Author: murf
Date: Thu Oct 12 08:20:02 2006
New Revision: 44923
URL: http://svn.digium.com/view/asterisk?rev=44923&view=rev
Log:
The channel has buffers for exten and context; it would be better to have pointers to structs; but for now, store the names and use strcmp; reduces the speedup, tho
Modified:
team/murf/fast-ast/main/pbx.c
Modified: team/murf/fast-ast/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/main/pbx.c?rev=44923&r1=44922&r2=44923&view=diff
==============================================================================
--- team/murf/fast-ast/main/pbx.c (original)
+++ team/murf/fast-ast/main/pbx.c Thu Oct 12 08:20:02 2006
@@ -2710,8 +2710,8 @@
char dst_exten[256]; /* buffer to accumulate digits */
int pos = 0; /* XXX should check bounds */
int digit = 0;
- char *last_context = 0;
- char *last_extension = 0;
+ char last_context[AST_MAX_CONTEXT];
+ char last_extension[AST_MAX_EXTENSION];
int last_priority = 0;
struct ast_exten *target=0;
@@ -2721,8 +2721,8 @@
*/
while (pbx_extension_helper(c, NULL, c->context, c->exten, c->priority, NULL, c->cid.cid_num, E_MATCH, &target)) {
found = 1;
- last_context = c->context;
- last_extension = c->exten;
+ strcpy(last_context, c->context);
+ strcpy(last_extension, c->exten);
last_priority = c->priority;
/* we call pbx_extension_helper(...E_SPAWN...) here instead of ast_spawn_extension, so we can use
* the extension previously looked up instead of forcing a fresh search for extension
@@ -2777,7 +2777,7 @@
* to the next extension, it's already at the peer pointer on the extension we just ran! If all
* the planets are in alignment, set the target to point to the next extension, and we won't be searching!
*/
- if (c->context == last_context && c->exten == last_extension && c->priority == last_priority+1 && target && target->peer && target->peer->priority == c->priority)
+ if (c->priority == last_priority+1 && strcasecmp(c->context,last_context) == 0 && strcasecmp(c->exten,last_extension) == 0 && target && target->peer && target->peer->priority == c->priority)
target = target->peer;
else
target = 0;
More information about the asterisk-commits
mailing list