asterisk/rest-api-templates
George Joseph 3d5ae0b5e1 ARI: REST over Websocket
This commit adds the ability to make ARI REST requests over the same
websocket used to receive events.

For full details on how to use the new capability, visit...

https://docs.asterisk.org/Configuration/Interfaces/Asterisk-REST-Interface-ARI/ARI-REST-over-WebSocket/

Changes:

* Added utilities to http.c:
  * ast_get_http_method_from_string().
  * ast_http_parse_post_form().
* Added utilities to json.c:
  * ast_json_nvp_array_to_ast_variables().
  * ast_variables_to_json_nvp_array().
* Added definitions for new events to carry REST responses.
* Created res/ari/ari_websocket_requests.c to house the new request handlers.
* Moved non-event specific code out of res/ari/resource_events.c into
  res/ari/ari_websockets.c
* Refactored res/res_ari.c to move non-http code out of ast_ari_callback()
  (which is http specific) and into ast_ari_invoke() so it can be shared
  between both the http and websocket transports.

UpgradeNote: This commit adds the ability to make ARI REST requests over the same
websocket used to receive events.
See https://docs.asterisk.org/Configuration/Interfaces/Asterisk-REST-Interface-ARI/ARI-REST-over-WebSocket/
2025-04-02 12:16:41 +00:00
..
api.wiki.mustache docs: Enable since/version handling for XML, CLI and ARI documentation 2025-01-16 08:13:21 -07:00
ari.make.mustache Build System: Create Makefile macro MOD_ADD_SOURCE. 2015-04-14 12:53:03 -04:00
ari_model_validators.c.mustache Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
ari_model_validators.h.mustache res_ari: Fix for Doxygen. 2021-11-18 16:25:51 -06:00
ari_resource.c.mustache Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
ari_resource.h.mustache ARI: REST over Websocket 2025-04-02 12:16:41 +00:00
asterisk_processor.py ari-stubs: Avoid 'is' as comparism with an literal. 2021-11-18 15:31:38 -06:00
body_parsing.mustache ARI: Support channel variables in originate 2014-01-21 14:27:21 +00:00
do-not-edit.mustache This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00
make_ari_stubs.py ari-stubs: Fix broken documentation anchors 2023-09-05 09:51:19 -06:00
models.wiki.mustache ari-stubs: Fix broken documentation anchors 2023-09-05 09:51:19 -06:00
odict.py This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00
param_cleanup.mustache ARI - implement allowMultiple for parameters 2013-08-02 14:36:32 +00:00
param_parsing.mustache ari: Implement 'debug all' and request/response logging 2017-01-23 10:25:58 -07:00
README.txt This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00
res_ari_resource.c.mustache ARI: REST over Websocket 2025-04-02 12:16:41 +00:00
rest_handler.mustache ari: User better nicknames for ARI operations 2013-11-07 21:10:31 +00:00
swagger_model.py swagger_model.py: Fix invalid escape sequence in get_list_parameter_type(). 2025-03-05 21:43:02 +00:00
transform.py rest-api-templates: Spelling fixes 2021-11-15 15:50:05 -06:00

This directory contains templates and template processing code for generating
HTTP bindings for the RESTful API's.

The RESTful API's are declared using [Swagger][swagger]. While Swagger provides
a [code generating toolkit][swagger-codegen], it requires Java to run, which
would be an unusual dependency to require for Asterisk developers.

This code generator is similar, but written in Python. Templates are processed
by using [pystache][pystache], which is a fairly simply Python implementation of
[mustache][mustache].

 [swagger]: https://github.com/wordnik/swagger-core/wiki
 [swagger-codegen]: https://github.com/wordnik/swagger-codegen
 [pystache]: https://github.com/defunkt/pystache
 [mustache]: http://mustache.github.io/