Skip to content
Snippets Groups Projects
Commit a31bf777 authored by David Baker's avatar David Baker
Browse files

Make turn server endpoint return an empty object if no turn servers to

match the normal response. Don't break if the turn_uris option isn't
present.
parent 6806caff
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ class VoipConfig(Config): ...@@ -19,7 +19,7 @@ class VoipConfig(Config):
def __init__(self, args): def __init__(self, args):
super(VoipConfig, self).__init__(args) super(VoipConfig, self).__init__(args)
self.turn_uris = args.turn_uris.split(",") self.turn_uris = args.turn_uris.split(",") if args.turn_uris else None
self.turn_shared_secret = args.turn_shared_secret self.turn_shared_secret = args.turn_shared_secret
self.turn_user_lifetime = args.turn_user_lifetime self.turn_user_lifetime = args.turn_user_lifetime
......
...@@ -34,7 +34,7 @@ class VoipRestServlet(RestServlet): ...@@ -34,7 +34,7 @@ class VoipRestServlet(RestServlet):
turnSecret = self.hs.config.turn_shared_secret turnSecret = self.hs.config.turn_shared_secret
userLifetime = self.hs.config.turn_user_lifetime userLifetime = self.hs.config.turn_user_lifetime
if not turnUris or not turnSecret or not userLifetime: if not turnUris or not turnSecret or not userLifetime:
defer.returnValue( (200, {"uris": []}) ) defer.returnValue( (200, {}) )
expiry = self.hs.get_clock().time_msec() + userLifetime expiry = self.hs.get_clock().time_msec() + userLifetime
username = "%d:%s" % (expiry, auth_user.to_string()) username = "%d:%s" % (expiry, auth_user.to_string())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment