[svn-commits] file: trunk r116848 - /trunk/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri May 16 16:34:46 CDT 2008


Author: file
Date: Fri May 16 16:34:45 2008
New Revision: 116848

URL: http://svn.digium.com/view/asterisk?view=rev&rev=116848
Log:
Try to fix attended transfers.

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=116848&r1=116847&r2=116848
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri May 16 16:34:45 2008
@@ -11161,12 +11161,18 @@
 					  sip_pvt_ptr->theirtag, sip_pvt_ptr->tag);
 			return 0;
 		}
-		sip_pvt_unlock(sip_pvt_ptr);
 		
 		if (totag)
 			ast_debug(4, "Matched %s call - their tag is %s Our tag is %s\n",
 					  ast_test_flag(&sip_pvt_ptr->flags[0], SIP_OUTGOING) ? "OUTGOING": "INCOMING",
 					  sip_pvt_ptr->theirtag, sip_pvt_ptr->tag);
+
+		/* deadlock avoidance... */
+		while (sip_pvt_ptr->owner && ast_channel_trylock(sip_pvt_ptr->owner)) {
+			sip_pvt_unlock(sip_pvt_ptr);
+			usleep(1);
+			sip_pvt_lock(sip_pvt_ptr);
+		}
 	}
 	
 	return sip_pvt_ptr;




More information about the svn-commits mailing list