summaryrefslogtreecommitdiff
path: root/main/devicestate.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/devicestate.c')
-rw-r--r--main/devicestate.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/main/devicestate.c b/main/devicestate.c
index 3580b1af7..c4a57dd68 100644
--- a/main/devicestate.c
+++ b/main/devicestate.c
@@ -304,9 +304,12 @@ enum ast_device_state ast_parse_device_state(const char *device)
return AST_DEVICE_UNKNOWN;
}
- res = (ast_channel_state(chan) == AST_STATE_RINGING) ? AST_DEVICE_RINGING : AST_DEVICE_INUSE;
-
- chan = ast_channel_unref(chan);
+ if (ast_channel_hold_state(chan) == AST_CONTROL_HOLD) {
+ res = AST_DEVICE_ONHOLD;
+ } else {
+ res = ast_state_chan2dev(ast_channel_state(chan));
+ }
+ ast_channel_unref(chan);
return res;
}