[Asterisk-cvs] asterisk/channels chan_phone.c,1.33.2.2,1.33.2.3

russell at lists.digium.com russell at lists.digium.com
Mon May 9 23:52:13 CDT 2005


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

Modified Files:
      Tag: v1-0
	chan_phone.c 
Log Message:
add fixup routine (bug #3825)


Index: chan_phone.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_phone.c,v
retrieving revision 1.33.2.2
retrieving revision 1.33.2.3
diff -u -d -r1.33.2.2 -r1.33.2.3
--- chan_phone.c	5 Apr 2005 07:10:06 -0000	1.33.2.2
+++ chan_phone.c	10 May 2005 03:58:26 -0000	1.33.2.3
@@ -668,6 +668,14 @@
 	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 @@
 		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);




More information about the svn-commits mailing list