[Asterisk-cvs] asterisk/channels chan_modem.c,1.30,1.31

markster at lists.digium.com markster at lists.digium.com
Sat Oct 23 07:46:18 CDT 2004


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

Modified Files:
	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.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- chan_modem.c	23 Oct 2004 06:03:29 -0000	1.30
+++ chan_modem.c	23 Oct 2004 11:50:04 -0000	1.31
@@ -510,6 +510,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;
@@ -529,6 +541,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 (!ast_strlen_zero(i->cid_num))




More information about the svn-commits mailing list