[asterisk-commits] anthonyl: branch anthonyl/8048-1.4 r44007 - /team/anthonyl/8048-1.4/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Sep 29 10:12:35 MST 2006


Author: anthonyl
Date: Fri Sep 29 12:12:34 2006
New Revision: 44007

URL: http://svn.digium.com/view/asterisk?rev=44007&view=rev
Log:
patch on

Modified:
    team/anthonyl/8048-1.4/channels/chan_local.c

Modified: team/anthonyl/8048-1.4/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/8048-1.4/channels/chan_local.c?rev=44007&r1=44006&r2=44007&view=diff
==============================================================================
--- team/anthonyl/8048-1.4/channels/chan_local.c (original)
+++ team/anthonyl/8048-1.4/channels/chan_local.c Fri Sep 29 12:12:34 2006
@@ -129,6 +129,7 @@
 	char *exten = ast_strdupa(data);
 	char *context = NULL, *opts = NULL;
 	int res;
+	struct local_pvt *lp;
 
 	if (!(context = strchr(exten, '@'))) {
 		ast_log(LOG_WARNING, "Someone used Local/%s somewhere without a @context. This is bad.\n", exten);
@@ -146,8 +147,17 @@
 	res = ast_exists_extension(NULL, context, exten, 1, NULL);
 	if (!res)		
 		return AST_DEVICE_INVALID;
-	else
-		return AST_DEVICE_UNKNOWN;
+	
+	res =  AST_DEVICE_NOT_INUSE;
+	AST_LIST_LOCK(&locals);
+	AST_LIST_TRAVERSE(&locals, lp, list) {
+		if (!strcmp(exten, lp->exten) && !strcmp(context, lp->context) && lp->owner) {
+			res = AST_DEVICE_INUSE;
+			break;
+		}
+	}
+	AST_LIST_UNLOCK(&locals);
+	return res;
 }
 
 static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_frame *f, struct ast_channel *us)



More information about the asterisk-commits mailing list