[asterisk-commits] russell: trunk r73886 - /trunk/res/res_features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jul 8 08:22:31 CDT 2007


Author: russell
Date: Sun Jul  8 08:22:30 2007
New Revision: 73886

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73886
Log:
ast_exists_extension() does not return an ast_device_state, so change this
function to explicitly check for the int return value.  Also, make a few
other minor changes such as removing a variable.

Modified:
    trunk/res/res_features.c

Modified: trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_features.c?view=diff&rev=73886&r1=73885&r2=73886
==============================================================================
--- trunk/res/res_features.c (original)
+++ trunk/res/res_features.c Sun Jul  8 08:22:30 2007
@@ -334,22 +334,21 @@
 /*! \brief metermaids callback from devicestate.c */
 static enum ast_device_state metermaidstate(const char *data)
 {
-	enum ast_device_state res = AST_DEVICE_INVALID;
-	char *context = ast_strdupa(data);
+	char *context;
 	char *exten;
+
+	context = ast_strdupa(data);
 
 	exten = strsep(&context, "@");
 	if (!context)
-		return res;
+		return AST_DEVICE_INVALID;
 	
 	ast_debug(4, "Checking state of exten %s in context %s\n", exten, context);
 
-	res = ast_exists_extension(NULL, context, exten, 1, NULL);
-
-	if (res == AST_DEVICE_UNKNOWN)
+	if (!ast_exists_extension(NULL, context, exten, 1, NULL))
 		return AST_DEVICE_NOT_INUSE;
-	else
-		return AST_DEVICE_INUSE;
+
+	return AST_DEVICE_INUSE;
 }
 
 /*! \brief Park a call 




More information about the asterisk-commits mailing list