summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2005-03-30 06:39:39 +0000
committerMark Spencer <markster@digium.com>2005-03-30 06:39:39 +0000
commitcadd117ed0140e42e3088013b570dff44a619322 (patch)
tree134584fe198f2a7edf651ec0c9e24fff73173c87
parentd3ba986fff7f677c7ed095815d623f4603a055cb (diff)
Add fixup to chan_phone (bug #3825)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-xchannels/chan_phone.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 62778ed76..5cee02e6f 100755
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -140,6 +140,7 @@ static struct ast_frame *phone_read(struct ast_channel *ast);
static int phone_write(struct ast_channel *ast, struct ast_frame *frame);
static struct ast_frame *phone_exception(struct ast_channel *ast);
static int phone_send_text(struct ast_channel *ast, const char *text);
+static int phone_fixup(struct ast_channel *old, struct ast_channel *new);
static const struct ast_channel_tech phone_tech = {
.type = type,
@@ -153,6 +154,7 @@ static const struct ast_channel_tech phone_tech = {
.read = phone_read,
.write = phone_write,
.exception = phone_exception,
+ .fixup = phone_fixup
};
static struct ast_channel_tech phone_tech_fxs = {
@@ -168,10 +170,19 @@ static struct ast_channel_tech phone_tech_fxs = {
.exception = phone_exception,
.write_video = phone_write,
.send_text = phone_send_text,
+ .fixup = phone_fixup
};
static struct ast_channel_tech *cur_tech;
+static int phone_fixup(struct ast_channel *old, struct ast_channel *new)
+{
+ struct phone_pvt *pvt = old->tech_pvt;
+ if (pvt && pvt->owner == old)
+ pvt->owner = new;
+ return 0;
+}
+
static int phone_digit(struct ast_channel *ast, char digit)
{
struct phone_pvt *p;