diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/redis/MeetingMessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/redis/MeetingMessageHandler.java index aa206ec4f5..bfa607e7a6 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/redis/MeetingMessageHandler.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/redis/MeetingMessageHandler.java @@ -48,7 +48,7 @@ public class MeetingMessageHandler implements MessageHandler { bbbGW.destroyMeeting(emm.meetingId); } else if (msg instanceof ValidateAuthTokenMessage) { ValidateAuthTokenMessage emm = (ValidateAuthTokenMessage) msg; - log.info("Received ValidateAuthTokenMessage toekn request. Meeting id [{}]", emm.meetingId); + log.info("Received ValidateAuthTokenMessage token request. Meeting id [{}]", emm.meetingId); bbbGW.validateAuthToken(emm.meetingId, emm.userId, emm.token, emm.replyTo); } } diff --git a/client/bbb-html5-client/config.coffee b/client/bbb-html5-client/config.coffee index 48c52d2488..f11eb9c02b 100755 --- a/client/bbb-html5-client/config.coffee +++ b/client/bbb-html5-client/config.coffee @@ -28,7 +28,9 @@ config.redis.post = "6379" config.redis.timeout = 5000 config.redis.channels = {} config.redis.channels.fromBBBApps = "bigbluebutton:from-bbb-apps:*" -config.redis.channels.toBBBApps = "bigbluebutton:to-bbb-apps:*" +config.redis.channels.toBBBApps = {} +config.redis.channels.toBBBApps.pattern = "bigbluebutton:to-bbb-apps:*" +config.redis.channels.toBBBApps.meeting = "bigbluebutton:to-bbb-apps:meeting" config.redis.internalChannels = {} config.redis.internalChannels.receive = "html5-receive" config.redis.internalChannels.reply = "html5-reply" diff --git a/client/bbb-html5-client/lib/redispubsub.coffee b/client/bbb-html5-client/lib/redispubsub.coffee index 91979abd4f..04e56adc2e 100644 --- a/client/bbb-html5-client/lib/redispubsub.coffee +++ b/client/bbb-html5-client/lib/redispubsub.coffee @@ -57,10 +57,10 @@ module.exports = class RedisPubSub # put the entry in the hash so we can match the response later @pendingRequests[correlationId] = entry - message.header.replyTo = correlationId - - log.info({ message: message }, "Publishing a message") - @pubClient.publish(config.redis.channels.toBBBApps, JSON.stringify(message)) + message.header.reply_to = correlationId + console.log("\n\n\n\n\nmessage=" + JSON.stringify(message) + "\n\n\n") + log.info({ message: message, channel: config.redis.channels.toBBBApps.meeting}, "Publishing a message") + @pubClient.publish(config.redis.channels.toBBBApps.meeting, JSON.stringify(message)) # Send a message without waiting for a reply send: (message, envelope) -> @@ -76,7 +76,7 @@ module.exports = class RedisPubSub message = JSON.parse(jsonMsg) # retrieve the request entry - correlationId = message.header?.replyTo + correlationId = message.header?.reply_to if correlationId? and @pendingRequests?[correlationId]? entry = @pendingRequests[correlationId] # make sure the message in the timeout isn't triggered by clearing it diff --git a/client/bbb-html5-client/public/js/models/connection.coffee b/client/bbb-html5-client/public/js/models/connection.coffee index 5691c4c1dc..cc2bbc0312 100755 --- a/client/bbb-html5-client/public/js/models/connection.coffee +++ b/client/bbb-html5-client/public/js/models/connection.coffee @@ -21,7 +21,7 @@ define [ connect: -> unless @socket? - console.log "\n\n\n\nconnecting to the socket.io server", @host + console.log "connecting to the socket.io server", @host @socket = io.connect() @_registerEvents() else @@ -52,31 +52,21 @@ define [ # Immediately say we are connected @socket.on "connect", => - console.log "socket on: connect\n\n\n\n" + console.log "socket on: connect" globals.events.trigger("connection:connected") #@socket.emit "user connect" # tell the server we have a new user - #emit the validate token json message - getUrlVars = ()-> vars = {} parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, (m,key,value) -> vars[key] = value - console.log "value=" + value ) vars - - - alert("url=" + window.location.href + - "auth_token=" + getUrlVars()["auth_token"] + - "user_id=" + getUrlVars()["user_id"] + - "meeting_id=" + getUrlVars()["meeting_id"] - ) message = { "payload": { "auth_token": getUrlVars()["auth_token"] - "user_id": getUrlVars()["user_id"] + "userid": getUrlVars()["user_id"] "meeting_id": getUrlVars()["meeting_id"] }, "header": { @@ -84,7 +74,11 @@ define [ "name": "validate_auth_token" } } - @socket.emit "message", message + + validFields = getUrlVars()["auth_token"]? and getUrlVars()["user_id"]? and getUrlVars()["meeting_id"]? + + #emit the validate token json message + @socket.emit "message", message if validFields # Received event to logout yourself @socket.on "logout", ->