From 5f53621223f8f7c94f0208bc0cffd6fa4d263422 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Tue, 5 Mar 2002 15:59:01 +0000 Subject: Version 0.1.11 from FTP git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_dial.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'apps') diff --git a/apps/app_dial.c b/apps/app_dial.c index 5b24c6f5a..0fbfad004 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -313,15 +313,34 @@ static int dial_exec(struct ast_channel *chan, void *data) cur = rest; continue; } + if (strlen(tmp->chan->call_forward)) { + if (option_verbose > 2) + ast_verbose(VERBOSE_PREFIX_3 "Forwarding call to '%s@%s'\n", tmp->chan->call_forward, tmp->chan->context); + /* Setup parameters */ + strncpy(chan->exten, tmp->chan->call_forward, sizeof(chan->exten)); + strncpy(chan->context, tmp->chan->context, sizeof(chan->context)); + chan->priority = 0; + to = 0; + ast_hangup(tmp->chan); + free(tmp); + cur = rest; + break; + } tmp->chan->appl = "AppDial"; tmp->chan->data = "(Outgoing Line)"; tmp->chan->whentohangup = 0; if (tmp->chan->callerid) free(tmp->chan->callerid); + if (tmp->chan->ani) + free(tmp->chan->ani); if (chan->callerid) tmp->chan->callerid = strdup(chan->callerid); else tmp->chan->callerid = NULL; + if (chan->ani) + tmp->chan->ani = strdup(chan->ani); + else + tmp->chan->ani = NULL; /* Presense of ADSI CPE on outgoing channel follows ours */ tmp->chan->adsicpe = chan->adsicpe; /* Place the call, but don't wait on the answer */ -- cgit v1.2.3