From b1f91b97d2085cc845d0f57bd9907de50c995105 Mon Sep 17 00:00:00 2001 From: russell Date: Sat, 1 Nov 2008 21:10:07 +0000 Subject: Merge changes from team/group/appdocsxml This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: http://svn.digium.com/svn/asterisk/trunk@153365 f38db490-d61c-443f-a65b-d21fe96a405b --- funcs/func_devstate.c | 79 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 28 deletions(-) (limited to 'funcs/func_devstate.c') diff --git a/funcs/func_devstate.c b/funcs/func_devstate.c index 1cedb3e53..f164cb7c1 100644 --- a/funcs/func_devstate.c +++ b/funcs/func_devstate.c @@ -44,6 +44,57 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/astdb.h" #include "asterisk/app.h" +/*** DOCUMENTATION + + + Get or Set a device state. + + + + + + The DEVICE_STATE function can be used to retrieve the device state from any + device state provider. For example: + NoOp(SIP/mypeer has state ${DEVICE_STATE(SIP/mypeer)}) + NoOp(Conference number 1234 has state ${DEVICE_STATE(MeetMe:1234)}) + The DEVICE_STATE function can also be used to set custom device state from + the dialplan. The Custom: prefix must be used. For example: + Set(DEVICE_STATE(Custom:lamp1)=BUSY) + Set(DEVICE_STATE(Custom:lamp2)=NOT_INUSE) + You can subscribe to the status of a custom device state using a hint in + the dialplan: + exten => 1234,hint,Custom:lamp1 + The possible values for both uses of this function are: + UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING | + RINGINUSE | ONHOLD + + + + + Get the devices set for a dialplan hint. + + + + + + + + + + + + + + The HINT function can be used to retrieve the list of devices that are + mapped to a dialplan hint. For example: + NoOp(Hint for Extension 1234 is ${HINT(1234)}) + + + ***/ + + static const char astdb_family[] = "CustomDevstate"; static int devstate_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) @@ -296,40 +347,12 @@ static struct ast_cli_entry cli_funcdevstate[] = { static struct ast_custom_function devstate_function = { .name = "DEVICE_STATE", - .synopsis = "Get or Set a device state", - .syntax = "DEVICE_STATE(device)", - .desc = - " The DEVICE_STATE function can be used to retrieve the device state from any\n" - "device state provider. For example:\n" - " NoOp(SIP/mypeer has state ${DEVICE_STATE(SIP/mypeer)})\n" - " NoOp(Conference number 1234 has state ${DEVICE_STATE(MeetMe:1234)})\n" - "\n" - " The DEVICE_STATE function can also be used to set custom device state from\n" - "the dialplan. The \"Custom:\" prefix must be used. For example:\n" - " Set(DEVICE_STATE(Custom:lamp1)=BUSY)\n" - " Set(DEVICE_STATE(Custom:lamp2)=NOT_INUSE)\n" - "You can subscribe to the status of a custom device state using a hint in\n" - "the dialplan:\n" - " exten => 1234,hint,Custom:lamp1\n" - "\n" - " The possible values for both uses of this function are:\n" - "UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING\n" - "RINGINUSE | ONHOLD\n", .read = devstate_read, .write = devstate_write, }; static struct ast_custom_function hint_function = { .name = "HINT", - .synopsis = "Get the devices set for a dialplan hint", - .syntax = "HINT(extension[@context][|options])", - .desc = - " The HINT function can be used to retrieve the list of devices that are\n" - "mapped to a dialplan hint. For example:\n" - " NoOp(Hint for Extension 1234 is ${HINT(1234)})\n" - "Options:\n" - " 'n' - Retrieve name on the hint instead of list of devices\n" - "", .read = hint_read, }; -- cgit v1.2.3