diff options
author | Erik Johnston <erik@matrix.org> | 2014-10-30 11:18:28 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-10-30 11:18:28 +0000 |
commit | ef9c4476a0eb653637040f86dd900252cad30567 (patch) | |
tree | ad14ecbbb2a03ceb47f8fba558994edd3d71b9df /synapse/rest/voip.py | |
parent | Fix SQL so that accepts we may want to persist events twice. (diff) | |
parent | SYWEB-12: Add a 'Room Info' button which displays all state content. (diff) | |
download | synapse-ef9c4476a0eb653637040f86dd900252cad30567.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into federation_authorization
Diffstat (limited to 'synapse/rest/voip.py')
-rw-r--r-- | synapse/rest/voip.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/rest/voip.py b/synapse/rest/voip.py index 0d0243a249..432c2475f8 100644 --- a/synapse/rest/voip.py +++ b/synapse/rest/voip.py @@ -34,23 +34,23 @@ class VoipRestServlet(RestServlet): turnSecret = self.hs.config.turn_shared_secret userLifetime = self.hs.config.turn_user_lifetime if not turnUris or not turnSecret or not userLifetime: - defer.returnValue( (200, {}) ) + defer.returnValue((200, {})) expiry = (self.hs.get_clock().time_msec() + userLifetime) / 1000 username = "%d:%s" % (expiry, auth_user.to_string()) - + mac = hmac.new(turnSecret, msg=username, digestmod=hashlib.sha1) - # We need to use standard base64 encoding here, *not* syutil's encode_base64 - # because we need to add the standard padding to get the same result as the - # TURN server. + # We need to use standard base64 encoding here, *not* syutil's + # encode_base64 because we need to add the standard padding to get the + # same result as the TURN server. password = base64.b64encode(mac.digest()) - defer.returnValue( (200, { + defer.returnValue((200, { 'username': username, 'password': password, 'ttl': userLifetime / 1000, 'uris': turnUris, - }) ) + })) def on_OPTIONS(self, request): return (200, {}) |