[Asterisk-cvs] asterisk/apps app_directed_pickup.c,1.1,1.2

markster markster
Sat Sep 24 10:25:05 CDT 2005


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

Modified Files:
	app_directed_pickup.c 
Log Message:
Fix directed pickup deadlock bug (bug #5270)


Index: app_directed_pickup.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_directed_pickup.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- app_directed_pickup.c	15 Sep 2005 20:28:23 -0000	1.1
+++ app_directed_pickup.c	24 Sep 2005 14:22:12 -0000	1.2
@@ -51,7 +51,7 @@
 
 static int pickup_exec(struct ast_channel *chan, void *data)
 {
-	int res = -1;
+	int res = 0;
 	struct localuser *u = NULL;
 	struct ast_channel *origin = NULL, *target = NULL;
 	char *tmp = NULL, *exten = NULL, *context = NULL;
@@ -100,6 +100,7 @@
 		if (res) {
 			ast_log(LOG_WARNING, "Unable to answer '%s'\n", chan->name);
 			res = -1;
+			ast_mutex_unlock(&target->lock);
 			goto out;
 		}
 		res = ast_queue_control(chan, AST_CONTROL_ANSWER);
@@ -107,12 +108,14 @@
 			ast_log(LOG_WARNING, "Unable to queue answer on '%s'\n",
 				chan->name);
 			res = -1;
+			ast_mutex_unlock(&target->lock);
 			goto out;
 		}
 		res = ast_channel_masquerade(target, chan);
 		if (res) {
 			ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan->name, target->name);
 			res = -1;
+			ast_mutex_unlock(&target->lock);
 			goto out;
 		}
 		/* Done */




More information about the svn-commits mailing list