[Asterisk-cvs] asterisk/apps app_dial.c,1.51,1.52
martinp at lists.digium.com
martinp at lists.digium.com
Thu Jan 15 17:40:35 CST 2004
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv21710/apps
Modified Files:
app_dial.c
Log Message:
Pass the callerid & ani to the new b-leg if the current b-leg requests call forwarding
Index: app_dial.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_dial.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- app_dial.c 15 Jan 2004 20:20:21 -0000 1.51
+++ app_dial.c 15 Jan 2004 23:32:27 -0000 1.52
@@ -202,12 +202,22 @@
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;
}
More information about the svn-commits
mailing list