Added forward context option from 5497
authorMatt O'Gorman <mogorman@digium.com>
Fri, 13 Jan 2006 19:09:05 +0000 (19:09 +0000)
committerMatt O'Gorman <mogorman@digium.com>
Fri, 13 Jan 2006 19:09:05 +0000 (19:09 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8066 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c
doc/README.variables

index e6571c9..cee81e0 100644 (file)
@@ -449,13 +449,15 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
                                        char tmpchan[256];
                                        char *stuff;
                                        char *tech;
+                                       char *forward_context;
                                        ast_copy_string(tmpchan, o->chan->call_forward, sizeof(tmpchan));
                                        if ((stuff = strchr(tmpchan, '/'))) {
                                                *stuff = '\0';
                                                stuff++;
                                                tech = tmpchan;
                                        } else {
-                                               snprintf(tmpchan, sizeof(tmpchan), "%s@%s", o->chan->call_forward, o->chan->context);
+                                               forward_context = pbx_builtin_getvar_helper(o->chan, "FORWARD_CONTEXT");
+                                               snprintf(tmpchan, sizeof(tmpchan), "%s@%s", o->chan->call_forward, forward_context ? forward_context : o->chan->context);
                                                stuff = tmpchan;
                                                tech = "Local";
                                        }
index 32abe78..b98ed4f 100644 (file)
@@ -592,6 +592,7 @@ ${PRIREDIRECTREASON}        Reason for redirect on PRI, if a call was directed
 ${RDNIS}               * Redirected Dial Number ID Service (Deprecated; use ${CALLERID(rdnis)})
 ${TIMESTAMP}           * Current date time in the format: YYYYMMDD-HHMMSS (Deprecated; use ${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
 ${TRANSFER_CONTEXT}    Context for transferred calls
+${FORWARD_CONTEXT}     Context for forwarded calls
 ${UNIQUEID}            * Current call unique identifier
 
 Application return values