aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-20 19:29:24 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-20 19:29:24 +0000
commit7ebe76f80c3f34723fccd0a651f82214924795ef (patch)
tree709b6dd8757db223eb85bc626e1e7a51576db252 /main
parentec7fb6b2acf9c77a963c79e4f99477b3449775af (diff)
Merged revisions 169510 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r169510 | twilson | 2009-01-20 13:22:24 -0600 (Tue, 20 Jan 2009) | 7 lines Make a proper builtin attended transfer to parking work This is an ugly hack from 1.4 that allows the timeout callback from a parked call to use the right channel name for the callback when the park is done with a builtin attended transfer (that isn't completed early). This hasn't ever worked in trunk and no one has complained yet, so eh. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@169541 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/features.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/main/features.c b/main/features.c
index 1ccb0a4e8..3d94fb82c 100644
--- a/main/features.c
+++ b/main/features.c
@@ -454,8 +454,30 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, in
if (extout)
*extout = x;
- if (peer)
- ast_copy_string(pu->peername, S_OR(orig_chan_name, peer->name), sizeof(pu->peername));
+ if (peer) {
+ /* This is so ugly that it hurts, but implementing get_base_channel() on local channels
+ could have ugly side effects. We could have transferer<->local,1<->local,2<->parking
+ and we need the callback name to be that of transferer. Since local,1/2 have the same
+ name we can be tricky and just grab the bridged channel from the other side of the local
+ */
+ if (!strcasecmp(peer->tech->type, "Local")) {
+ struct ast_channel *tmpchan, *base_peer;
+ char other_side[AST_CHANNEL_NAME];
+ char *c;
+ ast_copy_string(other_side, S_OR(orig_chan_name, peer->name), sizeof(other_side));
+ if ((c = strrchr(other_side, ';'))) {
+ *++c = '1';
+ }
+ if ((tmpchan = ast_get_channel_by_name_locked(other_side))) {
+ if ((base_peer = ast_bridged_channel(tmpchan))) {
+ ast_copy_string(pu->peername, base_peer->name, sizeof(pu->peername));
+ }
+ ast_channel_unlock(tmpchan);
+ }
+ } else {
+ ast_copy_string(pu->peername, S_OR(orig_chan_name, peer->name), sizeof(pu->peername));
+ }
+ }
/* Remember what had been dialed, so that if the parking
expires, we try to come back to the same place */