diff options
author | Anthony Minessale II <anthmct@yahoo.com> | 2004-04-26 23:22:34 +0000 |
---|---|---|
committer | Anthony Minessale II <anthmct@yahoo.com> | 2004-04-26 23:22:34 +0000 |
commit | 5385ca0a0e995904852027e5bc460c483c3263db (patch) | |
tree | 795ee349d435830084b8f5f9c00c84301b059439 /res | |
parent | f4b55b802cd21c343f26cc6e17c6fb2c48eeb5ea (diff) |
applied final release of bug 1353 per Mark's permission
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rwxr-xr-x | res/res_parking.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/res/res_parking.c b/res/res_parking.c index 1c9c11b7c..9c11f6a38 100755 --- a/res/res_parking.c +++ b/res/res_parking.c @@ -214,11 +214,13 @@ int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *peer, int return 0; } -int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allowredirect_in, int allowredirect_out, int allowdisconnect) + +int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast_bridge_config *config) { /* Copy voice back and forth between the two channels. Give the peer the ability to transfer calls with '#<extension' syntax. */ - int len; + + int len; struct ast_frame *f; struct ast_channel *who; char newext[256], *ptr; @@ -226,7 +228,12 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allo struct ast_option_header *aoh; struct ast_channel *transferer; struct ast_channel *transferee; - char *transferer_real_context; + char *transferer_real_context; + int allowdisconnect,allowredirect_in,allowredirect_out; + + allowdisconnect = config->allowdisconnect; + allowredirect_in = config->allowredirect_in; + allowredirect_out = config->allowredirect_out; /* Answer if need be */ if (ast_answer(chan)) @@ -246,7 +253,7 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allo peer->cdr = NULL; } for (;;) { - res = ast_channel_bridge(chan, peer, (allowdisconnect||allowredirect_out ? AST_BRIDGE_DTMF_CHANNEL_0 : 0) + (allowredirect_in ? AST_BRIDGE_DTMF_CHANNEL_1 : 0), &f, &who); + res = ast_channel_bridge(chan,peer,config,&f, &who); if (res < 0) { ast_log(LOG_WARNING, "Bridge failed on channels %s and %s\n", chan->name, peer->name); return -1; @@ -534,6 +541,8 @@ static int park_exec(struct ast_channel *chan, void *data) struct parkeduser *pu, *pl=NULL; int park; int dres; + struct ast_bridge_config config; + if (!data) { ast_log(LOG_WARNING, "Park requires an argument (extension number)\n"); return -1; @@ -575,7 +584,17 @@ static int park_exec(struct ast_channel *chan, void *data) were the person called. */ if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to parked call %d\n", chan->name, park); - res = ast_bridge_call(chan, peer, 1, 1, 0); + + memset(&config,0,sizeof(struct ast_bridge_config)); + config.allowredirect_in = 1; + config.allowredirect_out = 1; + config.allowdisconnect = 0; + config.timelimit = 0; + config.play_warning = 0; + config.warning_freq = 0; + config.warning_sound=NULL; + res = ast_bridge_call(chan,peer,&config); + /* Simulate the PBX hanging up */ if (res != AST_PBX_NO_HANGUP_PEER) ast_hangup(peer); |