Index: asterisk/channel.c =================================================================== RCS file: /usr/cvsroot/asterisk/channel.c,v retrieving revision 1.155 diff -u -r1.155 channel.c --- asterisk/channel.c 31 Dec 2004 00:04:41 -0000 1.155 +++ asterisk/channel.c 31 Dec 2004 18:11:21 -0000 @@ -2591,7 +2591,7 @@ long elapsed_ms=0, time_left_ms=0; int playit=0, playitagain=1, first_time=1; - flags = (config->allowdisconnect_out||config->allowredirect_out ? AST_BRIDGE_DTMF_CHANNEL_0 : 0) + (config->allowdisconnect_in||config->allowredirect_in ? AST_BRIDGE_DTMF_CHANNEL_1 : 0); + flags = (config->bridgedtmf_out ? AST_BRIDGE_DTMF_CHANNEL_0 : 0) + (config->bridgedtmf_in ? AST_BRIDGE_DTMF_CHANNEL_1 : 0); *fo = NULL; firstpass = config->firstpass; Index: asterisk/apps/app_dial.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_dial.c,v retrieving revision 1.116 diff -u -r1.116 app_dial.c --- asterisk/apps/app_dial.c 30 Dec 2004 01:17:07 -0000 1.116 +++ asterisk/apps/app_dial.c 31 Dec 2004 18:11:22 -0000 @@ -60,6 +60,8 @@ " This application returns -1 if the originating channel hangs up, or if the\n" "call is bridged and either of the parties in the bridge terminate the call.\n" "The option string may contain zero or more of the following characters:\n" +" 'b' -- make in channel dtmf processed\n" +" 'B' -- make out channel dtmf processed\n" " 't' -- allow the called user transfer the calling user by hitting #.\n" " 'T' -- allow the calling user to transfer the call by hitting #.\n" " 'f' -- Forces callerid to be set as the extension of the line \n" @@ -122,6 +124,10 @@ int musiconhold; int allowdisconnect_in; int allowdisconnect_out; + int allowredir_in; + int allowredir_out; + int bridgedtmf_in; + int bridgedtmf_out; int forcecallerid; int forwards; struct localuser *next; @@ -167,7 +173,7 @@ } while(0) -static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localuser *outgoing, int *to, int *allowredir_in, int *allowredir_out, int *allowdisconnect_in, int *allowdisconnect_out, int *sentringing, char *status, size_t statussize, int busystart, int nochanstart, int congestionstart) +static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localuser *outgoing, int *to, int *sentringing, char *status, size_t statussize, int busystart, int nochanstart, int congestionstart) { struct localuser *o; int found; @@ -238,10 +244,6 @@ if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name); peer = o->chan; - *allowredir_in = o->allowredirect_in; - *allowredir_out = o->allowredirect_out; - *allowdisconnect_in = o->allowdisconnect_in; - *allowdisconnect_out = o->allowdisconnect_out; } } else if (o->chan && (o->chan == winner)) { if (!ast_strlen_zero(o->chan->call_forward)) { @@ -348,10 +350,6 @@ if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name); peer = o->chan; - *allowredir_in = o->allowredirect_in; - *allowredir_out = o->allowredirect_out; - *allowdisconnect_in = o->allowdisconnect_in; - *allowdisconnect_out = o->allowdisconnect_out; } /* If call has been answered, then the eventual hangup is likely to be normal hangup */ in->hangupcause = AST_CAUSE_NORMAL_CLEARING; @@ -439,7 +437,7 @@ ast_frfree(f); return NULL; } - if (f && (f->frametype == AST_FRAME_DTMF) && *allowdisconnect_out && + if (f && (f->frametype == AST_FRAME_DTMF) && outgoing->allowdisconnect_out && (f->subclass == '*')) { if (option_verbose > 3) ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass); @@ -472,10 +470,6 @@ struct localuser *outgoing=NULL, *tmp; struct ast_channel *peer; int to; - int allowredir_in=0; - int allowredir_out=0; - int allowdisconnect_in=0; - int allowdisconnect_out=0; int hasmacro = 0; int privacy=0; int announce=0; @@ -789,24 +783,34 @@ } memset(tmp, 0, sizeof(struct localuser)); if (transfer) { - if (strchr(transfer, 't')) + if (strchr(transfer, 'b')) + tmp->bridgedtmf_in = 1; + else tmp->bridgedtmf_in = 0; + if (strchr(transfer, 'B')) + tmp->bridgedtmf_out = 1; + else tmp->bridgedtmf_out = 0; + if (strchr(transfer, 't')) { + tmp->bridgedtmf_in = 1; tmp->allowredirect_in = 1; - else tmp->allowredirect_in = 0; - if (strchr(transfer, 'T')) + } else tmp->allowredirect_in = 0; + if (strchr(transfer, 'T')) { + tmp->bridgedtmf_out = 1; tmp->allowredirect_out = 1; - else tmp->allowredirect_out = 0; + } else tmp->allowredirect_out = 0; if (strchr(transfer, 'r')) tmp->ringbackonly = 1; else tmp->ringbackonly = 0; if (strchr(transfer, 'm')) tmp->musiconhold = 1; else tmp->musiconhold = 0; - if (strchr(transfer, 'H')) - allowdisconnect_out = tmp->allowdisconnect_out = 1; - else allowdisconnect_out = tmp->allowdisconnect_out = 0; - if(strchr(transfer, 'h')) - allowdisconnect_in = tmp->allowdisconnect_in = 1; - else allowdisconnect_in = tmp->allowdisconnect_in = 0; + if (strchr(transfer, 'H')) { + tmp->bridgedtmf_out = 1; + tmp->allowdisconnect_out = 1; + } else tmp->allowdisconnect_out = 0; + if(strchr(transfer, 'h')) { + tmp->bridgedtmf_in = 1; + tmp->allowdisconnect_in = 1; + } else tmp->allowdisconnect_in = 0; if(strchr(transfer, 'g')) go_on=1; if (strchr(transfer, 'f')) @@ -1001,7 +1005,7 @@ strncpy(status, "CHANUNAVAIL", sizeof(status) - 1); time(&start_time); - peer = wait_for_answer(chan, outgoing, &to, &allowredir_in, &allowredir_out, &allowdisconnect_in, &allowdisconnect_out, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion); + peer = wait_for_answer(chan, outgoing, &to, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion); if (!peer) { if (to) @@ -1137,10 +1141,12 @@ memset(&config,0,sizeof(struct ast_bridge_config)); config.play_to_caller=play_to_caller; config.play_to_callee=play_to_callee; - config.allowredirect_in = allowredir_in; - config.allowredirect_out = allowredir_out; - config.allowdisconnect_in = allowdisconnect_in; - config.allowdisconnect_out = allowdisconnect_out; + config.allowredirect_in = tmp->allowredir_in; + config.allowredirect_out = tmp->allowredir_out; + config.allowdisconnect_in = tmp->allowdisconnect_in; + config.allowdisconnect_out = tmp->allowdisconnect_out; + config.bridgedtmf_in = tmp->bridgedtmf_in; + config.bridgedtmf_out = tmp->bridgedtmf_out; config.timelimit = timelimit; config.play_warning = play_warning; config.warning_freq = warning_freq; Index: asterisk/include/asterisk/channel.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/channel.h,v retrieving revision 1.65 diff -u -r1.65 channel.h --- asterisk/include/asterisk/channel.h 24 Dec 2004 01:40:07 -0000 1.65 +++ asterisk/include/asterisk/channel.h 31 Dec 2004 18:11:22 -0000 @@ -240,6 +240,8 @@ int allowredirect_out; int allowdisconnect_in; int allowdisconnect_out; + int bridgedtmf_in; + int bridgedtmf_out; long timelimit; long play_warning; long warning_freq;