asterisk/res/ari
Matt Jordan 9cffcca5f9 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
2015-05-22 11:13:34 -05:00
..
ari_model_validators.c ARI: Fix missing dependencies. 2015-04-29 07:46:44 -04:00
ari_model_validators.h res/ari: Fix model validation for ChannelHold event 2015-04-10 14:56:05 +00:00
ari_websockets.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
cli.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
config.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
internal.h res_http_websocket: Close websocket correctly and use careful fwrite 2014-06-26 12:21:14 +00:00
resource_applications.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
resource_applications.h ARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech 2014-07-22 16:20:58 +00:00
resource_asterisk.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
resource_asterisk.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00
resource_bridges.c res_ari_bridges: Add missing dependencies. 2015-05-05 09:53:18 -05:00
resource_bridges.h ARI: Improve wiki documentation 2015-01-27 17:21:03 +00:00
resource_channels.c ARI: Fix missing dependencies. 2015-04-29 07:46:44 -04:00
resource_channels.h ARI/PJSIP: Add the ability to redirect (transfer) a channel in a Stasis app 2015-02-12 20:34:37 +00:00
resource_device_states.c res_ari_device_states: Fix dependency on res_stasis_device_state. 2015-04-30 13:44:57 -05:00
resource_device_states.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00
resource_endpoints.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
resource_endpoints.h Multiple revisions 420089-420090,420097 2014-08-05 21:44:09 +00:00
resource_events.c res/ari: Register Stasis application on WebSocket attempt 2015-05-22 11:13:34 -05:00
resource_events.h res/ari: Register Stasis application on WebSocket attempt 2015-05-22 11:13:34 -05:00
resource_mailboxes.c ARI: Fix missing dependencies. 2015-04-29 07:46:44 -04:00
resource_mailboxes.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00
resource_playbacks.c ARI: Fix missing dependencies. 2015-04-29 07:46:44 -04:00
resource_playbacks.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00
resource_recordings.c ARI: Fix missing dependencies. 2015-04-29 07:46:44 -04:00
resource_recordings.h ari: Add a copy operation for stored recordings 2014-07-18 21:48:46 +00:00
resource_sounds.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
resource_sounds.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00