diff options
author | Matthew Jordan <mjordan@digium.com> | 2015-01-27 17:21:03 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2015-01-27 17:21:03 +0000 |
commit | fb8a2e039978b264737aa7a4ed08f9af4c329f47 (patch) | |
tree | fe2b256c707be4347f78c384468ffbf1aacba8dd /res | |
parent | aa8fd7d1b9dcbcc207cbcc333df850b3e8e0be54 (diff) |
ARI: Improve wiki documentation
This patch improves the documentation of ARI on the wiki. Specifically, it
addresses the following:
* Allowed values and allowed ranges weren't documented. This was particularly
frustrating, as Asterisk would reject query parameters with disallowed values
- but we didn't tell anyone what the allowed values were.
* The /play/id operation on /channels and /bridges failed to document all of
the added media resource types.
* Documentation for creating a channel into a Stasis application failed to
note when it occurred, and that creating a channel into Stasis conflicts with
creating a channel into the dialplan.
* Some other minor tweaks in the mustache templates, including italicizing the
parameter type, putting the default value on its own sub-bullet, and some
other nicities.
Review: https://reviewboard.asterisk.org/r/4351
........
Merged revisions 431145 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/ari/resource_bridges.c | 4 | ||||
-rw-r--r-- | res/ari/resource_bridges.h | 12 | ||||
-rw-r--r-- | res/ari/resource_channels.h | 26 | ||||
-rw-r--r-- | res/res_ari_bridges.c | 14 |
4 files changed, 28 insertions, 28 deletions
diff --git a/res/ari/resource_bridges.c b/res/ari/resource_bridges.c index 2dfb1cf9b..9ae0e9386 100644 --- a/res/ari/resource_bridges.c +++ b/res/ari/resource_bridges.c @@ -940,8 +940,8 @@ void ast_ari_bridges_create(struct ast_variable *headers, ast_bridge_snapshot_to_json(snapshot, stasis_app_get_sanitizer())); } -void ast_ari_bridges_create_or_update_with_id(struct ast_variable *headers, - struct ast_ari_bridges_create_or_update_with_id_args *args, +void ast_ari_bridges_create_with_id(struct ast_variable *headers, + struct ast_ari_bridges_create_with_id_args *args, struct ast_ari_response *response) { RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup); diff --git a/res/ari/resource_bridges.h b/res/ari/resource_bridges.h index 2b1e7873e..36ff6a017 100644 --- a/res/ari/resource_bridges.h +++ b/res/ari/resource_bridges.h @@ -80,8 +80,8 @@ int ast_ari_bridges_create_parse_body( * \param[out] response HTTP response */ void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response); -/*! Argument struct for ast_ari_bridges_create_or_update_with_id() */ -struct ast_ari_bridges_create_or_update_with_id_args { +/*! Argument struct for ast_ari_bridges_create_with_id() */ +struct ast_ari_bridges_create_with_id_args { /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set. */ const char *type; /*! Unique ID to give to the bridge being created. */ @@ -96,9 +96,9 @@ struct ast_ari_bridges_create_or_update_with_id_args { * \retval zero on success * \retval non-zero on failure */ -int ast_ari_bridges_create_or_update_with_id_parse_body( +int ast_ari_bridges_create_with_id_parse_body( struct ast_json *body, - struct ast_ari_bridges_create_or_update_with_id_args *args); + struct ast_ari_bridges_create_with_id_args *args); /*! * \brief Create a new bridge or updates an existing one. @@ -109,7 +109,7 @@ int ast_ari_bridges_create_or_update_with_id_parse_body( * \param args Swagger parameters * \param[out] response HTTP response */ -void ast_ari_bridges_create_or_update_with_id(struct ast_variable *headers, struct ast_ari_bridges_create_or_update_with_id_args *args, struct ast_ari_response *response); +void ast_ari_bridges_create_with_id(struct ast_variable *headers, struct ast_ari_bridges_create_with_id_args *args, struct ast_ari_response *response); /*! Argument struct for ast_ari_bridges_get() */ struct ast_ari_bridges_get_args { /*! Bridge's id */ @@ -306,7 +306,7 @@ int ast_ari_bridges_play_with_id_parse_body( /*! * \brief Start playback of media on a bridge. * - * The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.) + * The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.) * * \param headers HTTP headers * \param args Swagger parameters diff --git a/res/ari/resource_channels.h b/res/ari/resource_channels.h index dddfcf3a9..bd3b6205c 100644 --- a/res/ari/resource_channels.h +++ b/res/ari/resource_channels.h @@ -54,17 +54,17 @@ void ast_ari_channels_list(struct ast_variable *headers, struct ast_ari_channels struct ast_ari_channels_originate_args { /*! Endpoint to call. */ const char *endpoint; - /*! The extension to dial after the endpoint answers */ + /*! The extension to dial after the endpoint answers. Mutually exclusive with 'app'. */ const char *extension; - /*! The context to dial after the endpoint answers. If omitted, uses 'default' */ + /*! The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'. */ const char *context; - /*! The priority to dial after the endpoint answers. If omitted, uses 1 */ + /*! The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'. */ long priority; - /*! The label to dial after the endpoint answers. Will supersede 'priority' if provided. */ + /*! The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'. */ const char *label; - /*! The application that is subscribed to the originated channel, and passed to the Stasis application. */ + /*! The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */ const char *app; - /*! The application arguments to pass to the Stasis application. */ + /*! The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */ const char *app_args; /*! CallerID to use when dialing the endpoint or extension. */ const char *caller_id; @@ -119,17 +119,17 @@ struct ast_ari_channels_originate_with_id_args { const char *channel_id; /*! Endpoint to call. */ const char *endpoint; - /*! The extension to dial after the endpoint answers */ + /*! The extension to dial after the endpoint answers. Mutually exclusive with 'app'. */ const char *extension; - /*! The context to dial after the endpoint answers. If omitted, uses 'default' */ + /*! The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'. */ const char *context; - /*! The priority to dial after the endpoint answers. If omitted, uses 1 */ + /*! The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'. */ long priority; - /*! The label to dial after the endpoint answers. Will supersede priority, if provided */ + /*! The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'. */ const char *label; - /*! The application that is subscribed to the originated channel, and passed to the Stasis application. */ + /*! The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */ const char *app; - /*! The application arguments to pass to the Stasis application. */ + /*! The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */ const char *app_args; /*! CallerID to use when dialing the endpoint or extension. */ const char *caller_id; @@ -506,7 +506,7 @@ int ast_ari_channels_play_with_id_parse_body( /*! * \brief Start playback of media and specify the playbackId. * - * The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.) + * The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.) * * \param headers HTTP headers * \param args Swagger parameters diff --git a/res/res_ari_bridges.c b/res/res_ari_bridges.c index 1a91af95b..e0b9f789f 100644 --- a/res/res_ari_bridges.c +++ b/res/res_ari_bridges.c @@ -206,9 +206,9 @@ static void ast_ari_bridges_create_cb( fin: __attribute__((unused)) return; } -int ast_ari_bridges_create_or_update_with_id_parse_body( +int ast_ari_bridges_create_with_id_parse_body( struct ast_json *body, - struct ast_ari_bridges_create_or_update_with_id_args *args) + struct ast_ari_bridges_create_with_id_args *args) { struct ast_json *field; /* Parse query parameters out of it */ @@ -230,12 +230,12 @@ int ast_ari_bridges_create_or_update_with_id_parse_body( * \param headers HTTP headers. * \param[out] response Response to the HTTP request. */ -static void ast_ari_bridges_create_or_update_with_id_cb( +static void ast_ari_bridges_create_with_id_cb( struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_ari_response *response) { - struct ast_ari_bridges_create_or_update_with_id_args args = {}; + struct ast_ari_bridges_create_with_id_args args = {}; struct ast_variable *i; RAII_VAR(struct ast_json *, body, NULL, ast_json_unref); #if defined(AST_DEVMODE) @@ -273,11 +273,11 @@ static void ast_ari_bridges_create_or_update_with_id_cb( goto fin; } } - if (ast_ari_bridges_create_or_update_with_id_parse_body(body, &args)) { + if (ast_ari_bridges_create_with_id_parse_body(body, &args)) { ast_ari_response_alloc_failed(response); goto fin; } - ast_ari_bridges_create_or_update_with_id(headers, &args, response); + ast_ari_bridges_create_with_id(headers, &args, response); #if defined(AST_DEVMODE) code = response->response_code; @@ -1378,7 +1378,7 @@ static struct stasis_rest_handlers bridges_bridgeId = { .path_segment = "bridgeId", .is_wildcard = 1, .callbacks = { - [AST_HTTP_POST] = ast_ari_bridges_create_or_update_with_id_cb, + [AST_HTTP_POST] = ast_ari_bridges_create_with_id_cb, [AST_HTTP_GET] = ast_ari_bridges_get_cb, [AST_HTTP_DELETE] = ast_ari_bridges_destroy_cb, }, |