From: Russell Bryant Date: Tue, 10 May 2005 03:58:26 +0000 (+0000) Subject: add fixup routine (bug #3825) X-Git-Tag: 1.0.11.1~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34f9e85a119169a4233dd72160b50f0c5a365ea7;p=thirdparty%2Fasterisk.git add fixup routine (bug #3825) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5616 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_phone.c b/channels/chan_phone.c index 8b9b0db2ba..2204dd2995 100755 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -668,6 +668,14 @@ static int phone_write(struct ast_channel *ast, struct ast_frame *frame) return 0; } +static int phone_fixup(struct ast_channel *old, struct ast_channel *new) +{ + struct phone_pvt *pvt = old->pvt->pvt; + if (pvt && pvt->owner == old) + pvt->owner = new; + return 0; +} + static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *context) { struct ast_channel *tmp; @@ -691,6 +699,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *conte tmp->pvt->read = phone_read; tmp->pvt->write = phone_write; tmp->pvt->exception = phone_exception; + tmp->pvt->fixup = phone_fixup; strncpy(tmp->context, context, sizeof(tmp->context)-1); if (strlen(i->ext)) strncpy(tmp->exten, i->ext, sizeof(tmp->exten)-1);