diff options
author | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-01-15 23:32:27 +0000 |
---|---|---|
committer | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-01-15 23:32:27 +0000 |
commit | b362c2a04bed1919527ca713abc2a4278afe1de9 (patch) | |
tree | a637935512e84e9c1523359e878c94e93ebb2b9d /apps | |
parent | 7cda27eba171209d6b47f2ab4141670196fbe99a (diff) |
Pass the callerid & ani to the new b-leg if the current b-leg requests call forwarding
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2043 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/app_dial.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 812944c6f..f9e6b4282 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -202,12 +202,22 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s'\n", tmpchan); o->stillgoing = 0; numbusies++; - } else if (ast_call(o->chan, tmpchan, 0)) { - ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan); - o->stillgoing = 0; - ast_hangup(o->chan); - o->chan = NULL; - numbusies++; + } else { + if (in->callerid && !o->chan->callerid) { + o->chan->callerid = malloc(strlen(in->callerid) + 1); + strncpy(o->chan->callerid, in->callerid, strlen(in->callerid) + 1); + } + if (in->ani && !o->chan->ani) { + o->chan->ani = malloc(strlen(in->ani) + 1); + strncpy(o->chan->ani, in->ani, strlen(in->ani) + 1); + } + if (ast_call(o->chan, tmpchan, 0)) { + ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan); + o->stillgoing = 0; + ast_hangup(o->chan); + o->chan = NULL; + numbusies++; + } } continue; } |