mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 03:04:19 +00:00
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -334,21 +334,20 @@ static void notify_metermaids(const char *exten, char *context)
|
||||
/*! \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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user