diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-02-13 22:02:20 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-02-13 22:02:20 +0000 |
commit | f60efe347a9e0cceb9d2c917f86324fc6365dba6 (patch) | |
tree | 6c0ae108c47a878e9cc329ef2c330982e02b80a3 /res/res_features.c | |
parent | 83856d4683d5409a76f62bd1917cc5f049223651 (diff) |
This introduces a new dialplan function, DEVSTATE, which allows you to do some
pretty cool things.
First, you can get the device state of anything in the dialplan:
NoOp(SIP/mypeer has state ${DEVSTATE(SIP/mypeer)})
NoOp(The conference room 1234 has state ${DEVSTATE(MeetMe:1234)})
Most importantly, this allows you to create custom device states so you can
control phone lamps directly from the dialplan.
Set(DEVSTATE(Custom:mycustomlamp)=BUSY)
...
exten => mycustomlamp,hint,Custom:mycustomlamp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_features.c')
-rw-r--r-- | res/res_features.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_features.c b/res/res_features.c index 576cfaa5f..f383ebc9e 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -284,9 +284,9 @@ static void notify_metermaids(char *exten, char *context) } /*! \brief metermaids callback from devicestate.c */ -static int metermaidstate(const char *data) +static enum ast_device_state metermaidstate(const char *data) { - int res = AST_DEVICE_INVALID; + enum ast_device_state res = AST_DEVICE_INVALID; char *context = ast_strdupa(data); char *exten; @@ -299,7 +299,7 @@ static int metermaidstate(const char *data) res = ast_exists_extension(NULL, context, exten, 1, NULL); - if (!res) + if (res == AST_DEVICE_UNKNOWN) return AST_DEVICE_NOT_INUSE; else return AST_DEVICE_INUSE; |