Browse Source

Added server side ApiVersion returned with self to distinguish client and server API version support.

pull/192/head
Simon Eisenmann 11 years ago
parent
commit
69db76290d
  1. 14
      doc/CHANNELING-API.txt
  2. 3
      src/app/spreed-webrtc-server/channelling.go
  3. 2
      src/app/spreed-webrtc-server/channelling_api.go
  4. 4
      static/js/app.js

14
doc/CHANNELING-API.txt

@ -117,6 +117,7 @@ Special purpose documents for channling @@ -117,6 +117,7 @@ Special purpose documents for channling
"Suserid": "",
"Token": "some-very-long-string",
"Version": "server-version-number",
"ApiVersion": 1.4,
"Turn": {
"username": "turn-username",
"password": "turn-password",
@ -139,11 +140,16 @@ Special purpose documents for channling @@ -139,11 +140,16 @@ Special purpose documents for channling
Type : Self (string)
Id : Public Session id for this connection (string).
Sid : Secure (non public) id for this session (string).
Userid : User id if this session belongs to an authenticated user. Else empty.
Suserid : Secure (non public) user id if session has an user id. Else empty.
Token : Security token (string), to restablish connection with the same
session. Pass the value as URL query parameter t, to the websocket URL.
Userid : User id if this session belongs to an authenticated user.
Else empty.
Suserid : Secure (non public) user id if session has an user id.
Else empty.
Token : Security token (string), to restablish connection with the
same session. Pass the value as URL query parameter t, to
the websocket URL.
Version : Server version number. Use this to detect server upgrades.
ApiVersion : Server channeling API base version. Use this version to select
client side compatibility with the connected server.
Turn : Mapping (interface{}) to contain TURN server details, like
urls, password and username. See
http://tools.ietf.org/html/draft-uberti-behave-turn-rest-00

3
src/app/spreed-webrtc-server/channelling.go

@ -85,7 +85,8 @@ type DataSelf struct { @@ -85,7 +85,8 @@ type DataSelf struct {
Userid string
Suserid string
Token string
Version string
Version string // Server version.
ApiVersion float64 // Server channelling API version.
Turn *DataTurn
Stun []string
}

2
src/app/spreed-webrtc-server/channelling_api.go

@ -28,6 +28,7 @@ import ( @@ -28,6 +28,7 @@ import (
const (
maxConferenceSize = 100
apiVersion = 1.4 // Keep this in sync with CHANNELING-API docs.Hand
)
type ChannellingAPI interface {
@ -178,6 +179,7 @@ func (api *channellingAPI) HandleSelf(session *Session) (*DataSelf, error) { @@ -178,6 +179,7 @@ func (api *channellingAPI) HandleSelf(session *Session) (*DataSelf, error) {
Suserid: api.EncodeSessionUserID(session),
Token: token,
Version: api.Version,
ApiVersion: apiVersion,
Turn: api.CreateTurnData(session),
Stun: api.StunURIs,
}

4
static/js/app.js

@ -208,9 +208,9 @@ define([ @@ -208,9 +208,9 @@ define([
};
// Our API version as float. This value is incremented on
// Our client side API version as float. This value is incremented on
// breaking changes to plugins can check on it.
var apiversion = 1.4;
var apiversion = 1.1;
var initialize = function(app, launcher) {

Loading…
Cancel
Save