]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add missing fixup (bug #2667)
authorRussell Bryant <russell@russellbryant.com>
Sun, 24 Oct 2004 21:15:23 +0000 (21:15 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sun, 24 Oct 2004 21:15:23 +0000 (21:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4088 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_modem.c

index d53d3958a5e7dc655ea45b1e34f8e5fcffe12cd4..50a63bb7564804118e7177b3565e19aca678a8e9 100755 (executable)
@@ -509,6 +509,18 @@ static int modem_write(struct ast_channel *ast, struct ast_frame *frame)
        return res;
 }
 
+static int modem_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
+{
+        struct ast_modem_pvt *p = newchan->pvt->pvt;
+ast_log(LOG_WARNING, "fixup called\n");
+       if (p->owner!=oldchan) {
+           ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n",oldchan,p->owner);
+           return -1;
+       }
+       p->owner = newchan;
+        return 0; 
+}
+
 struct ast_channel *ast_modem_new(struct ast_modem_pvt *i, int state)
 {
        struct ast_channel *tmp;
@@ -528,6 +540,7 @@ struct ast_channel *ast_modem_new(struct ast_modem_pvt *i, int state)
                tmp->pvt->answer = modem_answer;
                tmp->pvt->read = modem_read;
                tmp->pvt->write = modem_write;
+               tmp->pvt->fixup = modem_fixup;
                strncpy(tmp->context, i->context, sizeof(tmp->context)-1);
                if (strlen(i->cid))
                        tmp->callerid = strdup(i->cid);