[Asterisk-code-review] res/ari: Register Stasis application on WebSocket attempt (asterisk[13])
Matt Jordan
asteriskteam at digium.com
Wed May 20 15:21:20 CDT 2015
Hello Joshua Colp,
I'd like you to reexamine a change. Please visit
https://gerrit.asterisk.org/486
to look at the new patch set (#3).
Change subject: res/ari: Register Stasis application on WebSocket attempt
......................................................................
res/ari: Register Stasis application on WebSocket attempt
Prior to this patch, when a WebSocket connection is made, ARI would not
be informed of the connection until after the WebSocket layer had
accepted the connection. This created a brief race condition where the
ARI client would be notified that it was connected, a channel would be
sent into the Stasis dialplan application, but ARI would not yet have
registered the Stasis application presented in the HTTP request that
established the WebSocket.
This patch resolves this issue by doing the following:
* When a WebSocket attempt is made, a callback is made into the ARI
application layer, which verifies and registers the apps presented in
the HTTP request. Because we do not yet have a WebSocket, we cannot
have an event session for the corresponding applications. Some
defensive checks were thus added to make the application objects
tolerant to a NULL event session.
* When a WebSocket connection is made, the registered application is
updated with the newly created event session that wraps the WebSocket
connection.
ASTERISK-24988 #close
Reported by: Joshua Colp
Change-Id: Ia5dc60dc2b6bee76cd5aff0f69dd53b36e83f636
---
M res/ari/resource_events.c
M res/ari/resource_events.h
M res/res_ari_events.c
M res/stasis/app.c
M rest-api-templates/ari_resource.h.mustache
M rest-api-templates/res_ari_resource.c.mustache
6 files changed, 233 insertions(+), 25 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/86/486/3
--
To view, visit https://gerrit.asterisk.org/486
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia5dc60dc2b6bee76cd5aff0f69dd53b36e83f636
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-code-review
mailing list