]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
add fixup routine (bug #3825)
authorRussell Bryant <russell@russellbryant.com>
Tue, 10 May 2005 03:58:26 +0000 (03:58 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 10 May 2005 03:58:26 +0000 (03:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5616 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_phone.c

index 8b9b0db2ba3f55926361a2e415ed9e3f5b4db447..2204dd29956b35c3cd5ecfbdd2cae830641b4bf7 100755 (executable)
@@ -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);