aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-08-22 15:29:30 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-08-22 15:29:30 +0000
commit60f067873b3254fee391f950f8f582271ee57c49 (patch)
tree6cdfd49d47574636daccffb18174e50c47b57dbd /res
parent52df5bbc40e267ce1ed3bf5df016559ed792455e (diff)
Version 0.2.0 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@506 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rwxr-xr-xres/res_parking.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/res/res_parking.c b/res/res_parking.c
index f61b25306..cad0421e5 100755
--- a/res/res_parking.c
+++ b/res/res_parking.c
@@ -171,7 +171,7 @@ int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *peer)
return 0;
}
-int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allowredirect)
+int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allowredirect, int allowdisconnect)
{
/* Copy voice back and forth between the two channels. Give the peer
the ability to transfer calls with '#<extension' syntax. */
@@ -182,14 +182,14 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allo
int res;
struct ast_option_header *aoh;
/* Answer if need be */
- if (chan->state != AST_STATE_UP) {
+ if (chan->_state != AST_STATE_UP) {
if (ast_answer(chan))
return -1;
}
peer->appl = "Bridged Call";
peer->data = chan->name;
for (;;) {
- res = ast_channel_bridge(chan, peer, allowredirect ? AST_BRIDGE_DTMF_CHANNEL_1 : 0, &f, &who);
+ res = ast_channel_bridge(chan, peer, (allowdisconnect ? AST_BRIDGE_DTMF_CHANNEL_0 : 0) + (allowredirect ? AST_BRIDGE_DTMF_CHANNEL_1 : 0), &f, &who);
if (res < 0) {
ast_log(LOG_WARNING, "Bridge failed on channels %s and %s\n", chan->name, peer->name);
return -1;
@@ -216,6 +216,14 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allo
ast_channel_setoption(chan, ntohs(aoh->option), aoh->data, f->datalen - sizeof(struct ast_option_header), 0);
}
}
+ if (f && (f->frametype == AST_FRAME_DTMF) && (who == chan) && allowdisconnect &&
+ (f->subclass == '*')) {
+ if (option_verbose > 3)
+ ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
+ res = -1;
+ break;
+
+ }
if ((f->frametype == AST_FRAME_DTMF) && (who == peer) && allowredirect &&
(f->subclass == '#')) {
memset(newext, 0, sizeof(newext));
@@ -438,7 +446,7 @@ 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(peer, chan, 1);
+ res = ast_bridge_call(peer, chan, 1, 0);
/* Simulate the PBX hanging up */
if (res != AST_PBX_KEEPALIVE)
ast_hangup(peer);