summaryrefslogtreecommitdiff
path: root/pbx.c
diff options
context:
space:
mode:
authorMatteo Brancaleoni <mbrancaleoni@espia.it>2003-02-24 06:00:18 +0000
committerMatteo Brancaleoni <mbrancaleoni@espia.it>2003-02-24 06:00:18 +0000
commit7a67a8faa37f118f7e7375059e958cc99e712aeb (patch)
tree388e986b909e145722de5c909a1496e0402a4ac7 /pbx.c
parent17769619c2d3d5c96c906a383ec06df2efbb0e35 (diff)
Mon Feb 24 07:00:01 CET 2003
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/pbx.c b/pbx.c
index d2c7bf90b..a7ed72064 100755
--- a/pbx.c
+++ b/pbx.c
@@ -710,12 +710,21 @@ static void pbx_substitute_variables_temp(struct ast_channel *c,char *cp3,char *
} else if (!strcmp(cp3, "EXTEN")) {
*cp4 = c->exten;
} else if (!strncmp(cp3, "EXTEN-", strlen("EXTEN-")) &&
+ /* XXX Remove me eventually */
(sscanf(cp3 + strlen("EXTEN-"), "%d", &offset) == 1)) {
if (offset < 0)
offset=0;
if (offset > strlen(c->exten))
offset = strlen(c->exten);
*cp4 = c->exten + offset;
+ ast_log(LOG_WARNING, "The use of 'EXTEN-foo' has been derprecated in favor of 'EXTEN:foo'\n");
+ } else if (!strncmp(cp3, "EXTEN:", strlen("EXTEN:")) &&
+ (sscanf(cp3 + strlen("EXTEN:"), "%d", &offset) == 1)) {
+ if (offset < 0)
+ offset=0;
+ if (offset > strlen(c->exten))
+ offset = strlen(c->exten);
+ *cp4 = c->exten + offset;
} else if (!strcmp(cp3, "RDNIS")) {
*cp4 = c->rdnis;
if (!(*cp4))
@@ -2784,8 +2793,8 @@ int ast_async_goto(struct ast_channel *chan, char *context, char *exten, int pri
struct ast_frame *f;
tmpchan = ast_channel_alloc(0);
if (tmpchan) {
- ast_setstate(tmpchan, chan->_state);
snprintf(tmpchan->name, sizeof(tmpchan->name), "AsyncGoto/%s", chan->name);
+ ast_setstate(tmpchan, chan->_state);
/* Make formats okay */
tmpchan->readformat = chan->readformat;
tmpchan->writeformat = chan->writeformat;