diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-07-08 13:22:30 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-07-08 13:22:30 +0000 |
commit | cf6ee48b5b27d8a6e8beb7c729639318bd2c3b47 (patch) | |
tree | 8c842960d32e8f8bc0d0f9b755a3fd7eacfc4e39 /res | |
parent | 74e8ab14fc7e5978327720e539b73dd89fc40d43 (diff) |
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
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/res/res_features.c b/res/res_features.c index 213fdbe05..1f7cab5d3 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -334,22 +334,21 @@ 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; + + return AST_DEVICE_INUSE; } /*! \brief Park a call |