[asterisk-app-dev] Event naming conventions
David M. Lee
dlee at digium.com
Mon Oct 21 09:56:24 CDT 2013
On Oct 21, 2013, at 8:09 AM, Alistair Cunningham <acunningham at integrics.com> wrote:
> When I now check this page:
>
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+REST+Data+Models
>
> I see no mention of Answer or Hangup. Have these already been removed, or am I looking on the wrong page?
That's the right page.
> I must confess that I'm not quite sure where to look on the Wiki for information about the websocket events. Is the "Data Models" page the same as the "Events" page? Matt showed me the correct place, but I foolishly failed to bookmark it. Apologies for the confusion…
No worries… it's new for everyone.
The "_ REST API" pages all of the basic structure. It leads off with a summary table, with HTTP method, URI path, return model (what you can expect as a response to the call) and a short summary of the operation.
The "Path" column links further down the page where you can find more details about the operation (longer description, operation parameters, etc.).
The "Return Model" column links into the "REST Data Models" page, where the return model schema is documented.
The /events WebSocket is a bit wonky, because it can return many different types of messages.
The way the model is structured, the 'Message' return model is actually a base-type for all of the events that could come over the /events WebSocket. If you click the 'Message' link, it will take you to the docs for that type, where all of the subtypes for Message are listed. That doc also tells you that the 'type' field in 'Message' is used as the discriminator, so you can tell what type of event you actually received.
While this all seems very clear to me, I'm the one who wrote it :-D
Suggestions for clarifying the wiki docs are gladly welcomed.
--
David M. Lee
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org
More information about the asterisk-app-dev
mailing list