[Asterisk-code-review] res/res http websocket: Add a pre-session established callback (asterisk[13])
Matt Jordan
asteriskteam at digium.com
Tue May 19 20:01:51 CDT 2015
Matt Jordan has uploaded a new patch set (#2).
Change subject: res/res_http_websocket: Add a pre-session established callback
......................................................................
res/res_http_websocket: Add a pre-session established callback
This patch updates http_websocket and its corresponding implementation
with a pre-session established callback. This callback allows for
WebSocket server consumers to be notified when a WebSocket connection is
attempted, but before we accept it. Consumers can choose to reject the
connection, if their application specific logic allows for it.
As a result, this patch pulls out the previously private
websocket_protocol struct and makes it public, as
ast_websocket_protocol. In order to preserve backwards compatibility
with existing modules, the existing APIs were left as-is, and new APIs
were added for the creation of the ast_websocket_protocol as well as for
adding a sub-protocol to a WebSocket server.
In particular, the following new API calls were added:
* ast_websocket_add_protocol2 - add a protocol to the core WebSocket
server
* ast_websocket_server_add_protocol2 - add a protocol to a specific
WebSocket server
* ast_websocket_sub_protocol_alloc - allocate a sub-protocol object.
Consumers can populate this with whatever callbacks they wish to
support, then add it to the core server or a specified server.
ASTERISK-24988
Reported by: Joshua Colp
Change-Id: Ibe0bbb30c17eec6b578071bdbd197c911b620ab2
---
M include/asterisk/http_websocket.h
M res/res_http_websocket.c
2 files changed, 172 insertions(+), 33 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/85/485/2
--
To view, visit https://gerrit.asterisk.org/485
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibe0bbb30c17eec6b578071bdbd197c911b620ab2
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
More information about the asterisk-code-review
mailing list