diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-08 22:15:46 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-08 22:15:46 +0000 |
commit | 1ca57e966d50990cf43a2d7507c812d57b60f1f1 (patch) | |
tree | 80f85213288417f6a6ff7226460bf4672e5433d6 /main/pbx.c | |
parent | 7bb652ea301eeb0a070447d2bb14fd4766bed1ed (diff) |
Merged revisions 205412 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r205412 | dvossel | 2009-07-08 17:15:06 -0500 (Wed, 08 Jul 2009) | 12 lines
Merged revisions 205409 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r205409 | dvossel | 2009-07-08 16:35:12 -0500 (Wed, 08 Jul 2009) | 6 lines
moving ast_devstate_to_extenstate to pbx.c from devicestate.c
ast_devstate_to_extenstate belongs in pbx.c. This change
fixes a compile time error with chan_vpb as well.
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@205413 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/main/pbx.c b/main/pbx.c index ca84d4301..a85105d64 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -3745,6 +3745,32 @@ static struct ast_exten *ast_hint_extension(struct ast_channel *c, const char *c return e; } +enum ast_extension_states ast_devstate_to_extenstate(enum ast_device_state devstate) +{ + switch (devstate) { + case AST_DEVICE_ONHOLD: + return AST_EXTENSION_ONHOLD; + 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); + case AST_DEVICE_RINGING: + return AST_EXTENSION_RINGING; + case AST_DEVICE_INUSE: + return AST_EXTENSION_INUSE; + case AST_DEVICE_NOT_INUSE: + return AST_EXTENSION_NOT_INUSE; + case AST_DEVICE_TOTAL: /* not a device state, included for completeness */ + break; + } + + return AST_EXTENSION_NOT_INUSE; +} + /*! \brief Check state of extension by using hints */ static int ast_extension_state2(struct ast_exten *e) { |