diff options
author | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-08 09:51:13 +0000 |
---|---|---|
committer | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-08 09:51:13 +0000 |
commit | f850b2194a051fdd69b9f0e95727526e1b379f4e (patch) | |
tree | 535d3ced318fcde4bfffde11b1cbe64fdee8cfcd /channels/chan_misdn.c | |
parent | 6bdcae1406cf05af01c2d04be9de030dfeca5c90 (diff) |
Fixed detection of dtmfs with bridged channels.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33011 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_misdn.c')
-rw-r--r-- | channels/chan_misdn.c | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index 4c7c9843d..4e6270a60 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -163,9 +163,11 @@ struct chan_list { int norxtone; int notxtone; - + int incoming_early_audio; + int ignore_dtmf; + int pipe[2]; char ast_rd_buf[4096]; struct ast_frame frame; @@ -2286,7 +2288,13 @@ static enum ast_bridge_result misdn_bridge (struct ast_channel *c0, ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name); chan_misdn_log(1, ch1->bc->port, "* Making Native Bridge between %s and %s\n", ch1->bc->oad, ch2->bc->oad); - + + if (! (flags&AST_BRIDGE_DTMF_CHANNEL_0) ) + ch1->ignore_dtmf=1; + + if (! (flags&AST_BRIDGE_DTMF_CHANNEL_1) ) + ch2->ignore_dtmf=1; + while(1) { to=-1; who = ast_waitfor_n(carr, 2, &to); @@ -2304,8 +2312,16 @@ static enum ast_bridge_result misdn_bridge (struct ast_channel *c0, break; } - - + + if ( f->frametype == AST_FRAME_DTMF ) { + chan_misdn_log(1,0,"Read DTMF %d from %s\n",f->subclass, who->exten); + + *fo=f; + *rc=who; + break; + } + + if (who == c0) { ast_write(c1,f); } @@ -2314,8 +2330,13 @@ static enum ast_bridge_result misdn_bridge (struct ast_channel *c0, } } - - return 0; + + chan_misdn_log(1, ch1->bc->port, "I SEND: Splitting conference with Number:%d\n", ch1->bc->pid +1); + + misdn_lib_split_bridge(ch1->bc,ch2->bc); + + + return AST_BRIDGE_COMPLETE; } /** AST INDICATIONS END **/ @@ -3181,9 +3202,12 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data) fr.mallocd =0 ; fr.offset= 0 ; - chan_misdn_log(2, bc->port, " --> DTMF:%c\n", bc->dtmf); - - ast_queue_frame(ch->ast, &fr); + if (!ch->ignore_dtmf) { + chan_misdn_log(2, bc->port, " --> DTMF:%c\n", bc->dtmf); + ast_queue_frame(ch->ast, &fr); + } else { + chan_misdn_log(2, bc->port, " --> Ingoring DTMF:%c due to bridge flags\n", bc->dtmf); + } } break; case EVENT_STATUS: |