From: David Vossel Date: Wed, 8 Jul 2009 22:16:18 +0000 (+0000) Subject: Merged revisions 205412 via svnmerge from X-Git-Tag: 1.6.1.3-rc1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d54c69ab823eb154680b985d98d4c3ea9dcdd82;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@205414 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/devicestate.h b/include/asterisk/devicestate.h index a88546ff9c..dd2cb90951 100644 --- a/include/asterisk/devicestate.h +++ b/include/asterisk/devicestate.h @@ -247,15 +247,6 @@ void ast_devstate_aggregate_add(struct ast_devstate_aggregate *agg, enum ast_dev */ enum ast_device_state ast_devstate_aggregate_result(struct ast_devstate_aggregate *agg); -/*! - * \brief Map devstate to an extension state. - * - * \param[in] device state - * - * \return the extension state mapping. - */ -enum ast_extension_states ast_devstate_to_extenstate(enum ast_device_state devstate); - /*! * \brief You shouldn't care about the contents of this struct * diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h index c6b3c7cb8a..ed21159c57 100644 --- a/include/asterisk/pbx.h +++ b/include/asterisk/pbx.h @@ -24,6 +24,7 @@ #define _ASTERISK_PBX_H #include "asterisk/sched.h" +#include "asterisk/devicestate.h" #include "asterisk/chanvars.h" #include "asterisk/hashtab.h" @@ -320,6 +321,14 @@ int ast_add_extension2(struct ast_context *con, int replace, const char *extensi int priority, const char *label, const char *callerid, const char *application, void *data, void (*datad)(void *), const char *registrar); +/*! + * \brief Map devstate to an extension state. + * + * \param[in] device state + * + * \return the extension state mapping. + */ +enum ast_extension_states ast_devstate_to_extenstate(enum ast_device_state devstate); /*! * \brief Uses hint and devicestate callback to get the state of an extension diff --git a/main/devicestate.c b/main/devicestate.c index 097ee714f9..b6a24e505e 100644 --- a/main/devicestate.c +++ b/main/devicestate.c @@ -821,31 +821,6 @@ void ast_devstate_aggregate_add(struct ast_devstate_aggregate *agg, enum ast_dev } } -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; -} enum ast_device_state ast_devstate_aggregate_result(struct ast_devstate_aggregate *agg) { diff --git a/main/pbx.c b/main/pbx.c index 45a999645f..146997a184 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -3256,6 +3256,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) {