aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-27 16:02:10 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-27 16:02:10 +0000
commita430ad96f169be844e1f7cb07a11b987d5a2e718 (patch)
tree222ea4bebf2753e9bfaf2022d13b51934a0610e0 /apps
parentbfd5f5705c5cc8678fca95c098aac6f30f61258e (diff)
Check for call forwarding while waiting for answer, too
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@705 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_dial.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index d1f0b5f60..b1edad6f4 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -186,6 +186,17 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
*allowdisconnect = o->allowdisconnect;
}
} else if (o->chan == winner) {
+ if (strlen(o->chan->call_forward)) {
+ /* Before processing channel, go ahead and check for forwarding */
+ if (option_verbose > 2)
+ ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s@%s' (thanks to %s)\n", in->name, o->chan->call_forward, o->chan->context, o->chan->name);
+ /* Setup parameters */
+ strncpy(in->exten, o->chan->call_forward, sizeof(in->exten));
+ strncpy(in->context, o->chan->context, sizeof(in->context));
+ in->priority = 0;
+ *to = 0;
+ break;
+ }
f = ast_read(winner);
if (f) {
if (f->frametype == AST_FRAME_CONTROL) {