[asterisk-addons-commits] objsys: branch 1.2 r271 - /branches/1.2/asterisk-ooh323c/src/chan_h323.c

asterisk-addons-commits at lists.digium.com asterisk-addons-commits at lists.digium.com
Tue Aug 8 08:31:03 MST 2006


Author: objsys
Date: Tue Aug  8 10:31:03 2006
New Revision: 271

URL: http://svn.digium.com/view/asterisk-addons?rev=271&view=rev
Log:
Fix for call transfer crash caused by change in ownership

Modified:
    branches/1.2/asterisk-ooh323c/src/chan_h323.c

Modified: branches/1.2/asterisk-ooh323c/src/chan_h323.c
URL: http://svn.digium.com/view/asterisk-addons/branches/1.2/asterisk-ooh323c/src/chan_h323.c?rev=271&r1=270&r2=271&view=diff
==============================================================================
--- branches/1.2/asterisk-ooh323c/src/chan_h323.c (original)
+++ branches/1.2/asterisk-ooh323c/src/chan_h323.c Tue Aug  8 10:31:03 2006
@@ -964,10 +964,31 @@
 static int ooh323_fixup
    (struct ast_channel *oldchan, struct ast_channel *newchan)
 {
-   if(gH323Debug)
-      ast_verbose("ooh323c ooh323_fixup\n");
-
-  return 0;
+   struct ooh323_pvt *p = newchan->tech_pvt;
+
+   if(gH323Debug)
+      ast_verbose("start: ooh323c ooh323_fixup\n");
+
+   ast_mutex_lock(&p->lock);
+   if (p->owner != oldchan) {
+      ast_log(LOG_WARNING, "Old channel wasn't %p but was %p\n", oldchan, p->owner);
+      ast_mutex_unlock(&p->lock);
+      return -1;
+   }
+
+   if (p->owner == oldchan) {
+      p->owner = newchan;
+   }
+   else {
+      p->owner = oldchan;
+   }
+
+   ast_mutex_unlock(&p->lock);
+
+   if(gH323Debug)
+      ast_verbose("end: ooh323c ooh323_fixup \n");
+
+   return 0;
 }
 
 



More information about the asterisk-addons-commits mailing list