[Asterisk-cvs] asterisk/channels chan_modem.c,1.27.2.1,1.27.2.2

russell at lists.digium.com russell at lists.digium.com
Sun Oct 24 17:11:46 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv21579/channels

Modified Files:
      Tag: v1-0
	chan_modem.c 
Log Message:
Add missing fixup (bug #2667)


Index: chan_modem.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem.c,v
retrieving revision 1.27.2.1
retrieving revision 1.27.2.2
diff -u -d -r1.27.2.1 -r1.27.2.2
--- chan_modem.c	24 Oct 2004 21:09:40 -0000	1.27.2.1
+++ chan_modem.c	24 Oct 2004 21:15:23 -0000	1.27.2.2
@@ -509,6 +509,18 @@
 	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 @@
 		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);




More information about the svn-commits mailing list