--- apps/app_dial.c.old 2004-09-30 16:41:29.000000000 -0400 +++ apps/app_dial.c 2004-10-01 09:01:12.000000000 -0400 @@ -71,6 +71,8 @@ " making/redirecting the outgoing call. For example, some PSTNs\n" " don't allow callerids from other extensions then the ones\n" " that are assigned to you.\n" +" 'F' -- Forces callerid to be set as the extension of the line \n" +" being transfered on call transfert\n" " 'r' -- indicate ringing to the calling party, pass no audio until answered.\n" " 'R' -- indicate ringing to the calling party when the called party indicates\n" " ringing, pass no audio until answered.\n" @@ -121,6 +123,7 @@ int allowdisconnect_in; int allowdisconnect_out; int forcecallerid; + int forcecalleridtransfer; struct localuser *next; }; @@ -221,6 +224,18 @@ *allowdisconnect_out = o->allowdisconnect_out; } } else if (o->chan && (o->chan == winner)) { + if (o->forcecalleridtransfer) { + + char *newcid = NULL; + + if (strlen(in->macroexten)) + newcid = in->macroexten; + else + newcid = in->exten; + + o->chan->callerid = strdup(newcid); + } + if (!ast_strlen_zero(o->chan->call_forward)) { char tmpchan[256]=""; char *stuff; @@ -714,6 +729,10 @@ if (strchr(transfer, 'f')) tmp->forcecallerid = 1; else tmp->forcecallerid = 0; + + if (strchr(transfer, 'F')) + tmp->forcecalleridtransfer = 1; + else tmp->forcecalleridtransfer = 0; } strncpy(numsubst, number, sizeof(numsubst)-1); /* If we're dialing by extension, look at the extension to know what to dial */