[asterisk-app-dev] Request regarding ARI REST APIs

Naftoli Gugenheim naftoligug at gmail.com
Wed Oct 23 16:27:02 CDT 2013


Hello. I am very excited about Asterisk 12 and ARI.

I noticed on the wiki that while most of the API endpoints (used to talk
*to* asterisk) are true REST, using HTTP, the events endpoint would
actually use websockets, not HTTP. Many people don't realize it, but
although websockets is often associated with "server push," HTML5
introduces another way to do server push efficiently, that works over HTTP,
namely SSE/EventSource. (See e.g.
http://www.html5rocks.com/en/tutorials/eventsource/basics/.) Although the
basic idea is nothing new; for instance CouchDB lets you watch events
streamed over HTTP (
http://guide.couchdb.org/draft/notifications.html#continuous). Websockets
are a much more powerful protocol, allowing for 2-way communication inline.

In some scenarios it may require more setup for application developers to
access websockets. For instance some platforms don't have the capability
built in and require adding a third-party dependency.
I would therefore like to request that you expose an HTTP endpoint that
streams events in a connection that can be kept open, preferably using the
SSE format.

Another argument that can be made, is that REST and websockets are two
different protocols. Instead of implementing the API half in one protocol
and half in another, why not have a complete REST API, *and* a complete
websockets API? After all, websockets are 2-way, so why not let websocket
users send commands to asterisk through it as well?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20131023/88a6e1b6/attachment.html>


More information about the asterisk-app-dev mailing list