Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F7172204
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/debian/control b/debian/control
index 822f6be..44134da 100644
--- a/debian/control
+++ b/debian/control
@@ -1,47 +1,47 @@
Source: sylkserver
Section: net
Priority: optional
Maintainer: Dan Pascu <dan@ag-projects.com>
Uploaders: Adrian Georgescu <ag@ag-projects.com>
Build-Depends: debhelper (>= 9), dh-python, dh-systemd, python-all (>= 2.7)
Standards-Version: 3.9.8
Package: sylkserver
Architecture: all
Depends: ${python:Depends}, ${misc:Depends},
lsb-base,
python-application (>= 2.5.0),
- python-autobahn (>= 0.10.3),
+ python-autobahn,
python-eventlib,
python-klein,
python-lxml,
python-sipsimple (>= 3.0.0),
python-twisted,
python-typing
Suggests: libavahi-compat-libdnssd1, python-wokkel, sylkserver-webrtc-gateway
Recommends: sylkserver-sounds
Description: Extensible real-time-communications application server
SylkServer is a SIP applications server that provides applications like
echo, playback and conference, as well as act as a gateway between SIP
and IRC, XMPP and WEBRTC.
Package: sylkserver-sounds
Architecture: all
Depends: ${misc:Depends}, sylkserver
Description: Extensible real-time-communications application server sounds
SylkServer is a SIP applications server that provides applications like
echo, playback and conference, as well as act as a gateway between SIP
and IRC, XMPP and WEBRTC.
.
This package contains sounds used by SylkServer.
Package: sylkserver-webrtc-gateway
Architecture: all
Depends: ${misc:Depends}, sylkserver, janus
Description: Extensible real-time-communications application server WebRTC gateway
SylkServer is a SIP applications server that provides applications like
echo, playback and conference, as well as act as a gateway between SIP
and IRC, XMPP and WEBRTC.
.
This is a meta-package containing the dependencies required to run the
WebRTC gateway application.
diff --git a/sylk/applications/webrtcgateway/protocol.py b/sylk/applications/webrtcgateway/protocol.py
index 78be2fc..32bb4f2 100644
--- a/sylk/applications/webrtcgateway/protocol.py
+++ b/sylk/applications/webrtcgateway/protocol.py
@@ -1,68 +1,63 @@
import json
from application.notification import NotificationCenter, NotificationData
from autobahn.twisted.websocket import WebSocketServerProtocol
-
-try:
- from autobahn.websocket.http import HttpException
-except ImportError:
- # AutoBahn 0.12 changed this
- from autobahn.websocket import ConnectionDeny as HttpException
+from autobahn.websocket import ConnectionDeny
from .handler import ConnectionHandler
from .janus import JanusBackend
from .logger import log
SYLK_WS_PROTOCOL = 'sylkRTC-2'
class SylkWebSocketServerProtocol(WebSocketServerProtocol):
janus_backend = JanusBackend()
connection_handler = None
notification_center = NotificationCenter()
def onConnect(self, request):
if SYLK_WS_PROTOCOL not in request.protocols:
log.info('Rejecting connection from %s, remote does not support our sub-protocol' % self.peer)
- raise HttpException(406, u'No compatible protocol specified')
+ raise ConnectionDeny(406, u'No compatible protocol specified')
if not self.janus_backend.ready:
log.info('Rejecting connection from %s, Janus backend is not connected' % self.peer)
- raise HttpException(503, u'Backend is not connected')
+ raise ConnectionDeny(503, u'Backend is not connected')
return SYLK_WS_PROTOCOL
def onOpen(self):
self.factory.connections.add(self)
self.connection_handler = ConnectionHandler(self)
self.connection_handler.start()
self.connection_handler.log.info('connected from {address}'.format(address=self.peer))
def onMessage(self, payload, is_binary):
if is_binary:
self.connection_handler.log.error('received invalid binary message')
return
self.notification_center.post_notification('WebRTCClientTrace', sender=self, data=NotificationData(direction='INCOMING', message=payload, peer=self.peer))
try:
data = json.loads(payload)
except Exception as e:
self.connection_handler.log.error('could not parse WebSocket payload: {exception!s}'.format(exception=e))
else:
self.connection_handler.handle_message(data)
def onClose(self, clean, code, reason):
if self.connection_handler is None: # Connection was closed very early before onOpen was even called
return
self.connection_handler.log.info('disconnected')
self.factory.connections.discard(self)
self.connection_handler.stop()
self.connection_handler = None
def sendMessage(self, payload, *args, **kw):
self.notification_center.post_notification('WebRTCClientTrace', sender=self, data=NotificationData(direction='OUTGOING', message=payload, peer=self.peer))
super(SylkWebSocketServerProtocol, self).sendMessage(payload, *args, **kw)
def disconnect(self, code=1000, reason=u''):
self.sendClose(code, reason)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 26, 7:45 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3414538
Default Alt Text
(5 KB)
Attached To
Mode
rSYLK SylkServer
Attached
Detach File
Event Timeline
Log In to Comment