asterisk/rest-api-templates
Ashley Sanders fe804b09b3 ARI: Channels added to Stasis application during WebSocket creation ...
Prior to ASTERISK-24988, the WebSocket handshake was resolved before Stasis
applications were registered. This was done such that the WebSocket would be
ready when an application is registered. However, by creating the WebSocket
first, the client had the ability to make requests for the Stasis application
it thought had been created with the initial handshake request. The inevitable
conclusion of this scenario was the cart being put before the horse.

ASTERISK-24988 resolved half of the problem by ensuring that the applications
were created and registered with Stasis prior to completing the handshake
with the client. While this meant that Stasis was ready when the client
received the green-light from Asterisk, it also meant that the WebSocket was
not yet ready for Stasis to dispatch messages.

This patch introduces a message queuing mechanism for delaying messages from
Stasis applications while the WebSocket is being constructed. When the ARI
event processor receives the message from the WebSocket that it is being
created, the event processor instantiates an event session which contains a
message queue. It then tries to create and register the requested applications
with Stasis. Messages that are dispatched from Stasis between this point and
the point at which the event processor is notified the WebSocket is ready, are
stashed in the queue. Once the WebSocket has been built, the queue's messages
are dispatched in the order in which they were originally received and the
queue is concurrently cleared.

ASTERISK-25181 #close
Reported By: Matt Jordan

Change-Id: Iafef7b85a2e0bf78c114db4c87ffc3d16d671a17
2015-07-31 11:28:10 -05:00
..
README.txt This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00
api.wiki.mustache ARI: Improve wiki documentation 2015-01-27 17:21:03 +00: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 Merge "ARI: Fix missing dependencies." 2015-04-29 16:44:09 -05:00
ari_model_validators.h.mustache ARI: Add subscription support 2013-10-04 16:01:48 +00:00
ari_resource.c.mustache Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE. 2015-04-29 01:02:10 -04:00
ari_resource.h.mustache ARI: Channels added to Stasis application during WebSocket creation ... 2015-07-31 11:28:10 -05:00
asterisk_processor.py ARI: Improve wiki documentation 2015-01-27 17:21:03 +00: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 make_ari_stubs: Update wiki prefix to '13' 2014-08-08 12:40:16 +00:00
models.wiki.mustache The Swagger 1.2 specification for type extension ended up being 2013-10-24 20:48:17 +00: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 Investigate and fix memory leaks in Asterisk 2015-01-23 15:21:56 +00:00
res_ari_resource.c.mustache ARI: Channels added to Stasis application during WebSocket creation ... 2015-07-31 11:28:10 -05:00
rest_handler.mustache ari: User better nicknames for ARI operations 2013-11-07 21:10:31 +00:00
swagger_model.py ARI: Improve wiki documentation 2015-01-27 17:21:03 +00:00
transform.py Update events to use Swagger 1.3 subtyping, and related aftermath 2013-07-03 16:32:41 +00:00

README.txt

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/