aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-03 18:40:56 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-03 18:40:56 +0000
commitef693b474008c88fce39d498608687a5fc749346 (patch)
tree8ea1f07cb07d36a10a0582bf61f8b3e559b0fc0a /main/channel.c
parentdb03061bf42ab2b998370662a0c670852f4b0962 (diff)
Preserve the indication currently playing on a channel when a masquerade operation happens. (issue #BE-88)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90548 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 3c4af0f93..25b4900db 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1817,6 +1817,7 @@ int ast_answer(struct ast_channel *chan)
default:
break;
}
+ chan->visible_indication = 0;
ast_channel_unlock(chan);
return res;
}
@@ -2608,6 +2609,7 @@ int ast_indicate_data(struct ast_channel *chan, int condition, const void *data,
ast_log(LOG_DEBUG, "Driver for channel '%s' does not support indication %d, emulating it\n", chan->name, condition);
ast_playtones_start(chan,0,ts->data, 1);
res = 0;
+ chan->visible_indication = condition;
} else if (condition == AST_CONTROL_PROGRESS) {
/* ast_playtones_stop(chan); */
} else if (condition == AST_CONTROL_PROCEEDING) {
@@ -2624,7 +2626,9 @@ int ast_indicate_data(struct ast_channel *chan, int condition, const void *data,
res = -1;
}
}
- }
+ } else
+ chan->visible_indication = condition;
+
return res;
}
@@ -3837,6 +3841,10 @@ int ast_do_masquerade(struct ast_channel *original)
} else
ast_log(LOG_WARNING, "Channel type '%s' does not have a fixup routine (for %s)! Bad things may happen.\n",
original->tech->type, original->name);
+
+ /* If an indication is currently playing maintain it on the channel that is taking the place of original */
+ if (original->visible_indication)
+ ast_indicate(original, original->visible_indication);
/* Now, at this point, the "clone" channel is totally F'd up. We mark it as
a zombie so nothing tries to touch it. If it's already been marked as a