Make invalid hints report Unavailable instead of Idle.

(closes issue #14413)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2009-06-26 19:31:14 +00:00
parent 59c1998d67
commit cce4fad522
3 changed files with 31 additions and 13 deletions

View File

@@ -4101,8 +4101,9 @@ static int ast_extension_state2(struct ast_exten *e)
rest = ast_str_buffer(hint); /* One or more devices separated with a & character */
while ( (cur = strsep(&rest, "&")) )
while ( (cur = strsep(&rest, "&")) ) {
ast_devstate_aggregate_add(&agg, ast_device_state(cur));
}
state = ast_devstate_aggregate_result(&agg);
@@ -4112,6 +4113,8 @@ static int ast_extension_state2(struct ast_exten *e)
case AST_DEVICE_BUSY:
return AST_EXTENSION_BUSY;
case AST_DEVICE_UNAVAILABLE:
case AST_DEVICE_UNKNOWN:
case AST_DEVICE_INVALID:
return AST_EXTENSION_UNAVAILABLE;
case AST_DEVICE_RINGINUSE:
return (AST_EXTENSION_INUSE | AST_EXTENSION_RINGING);
@@ -4119,8 +4122,6 @@ static int ast_extension_state2(struct ast_exten *e)
return AST_EXTENSION_RINGING;
case AST_DEVICE_INUSE:
return AST_EXTENSION_INUSE;
case AST_DEVICE_UNKNOWN:
case AST_DEVICE_INVALID:
case AST_DEVICE_NOT_INUSE:
return AST_EXTENSION_NOT_INUSE;
}