示例#1
0
class WebRTCGatewayApplication(SylkApplication):
    def __init__(self):
        self.web_handler = WebHandler()
        self.admin_web_handler = AdminWebHandler()

    def start(self):
        self.web_handler.start()
        self.admin_web_handler.start()
        # Load tokens from storage
        storage = TokenStorage()
        storage.load()

    def stop(self):
        self.web_handler.stop()
        self.admin_web_handler.stop()

    def incoming_session(self, session):
        log.msg(u'New incoming session %s from %s rejected' % (session.call_id, IdentityFormatter.format(session.remote_identity)))
        session.reject(403)

    def incoming_subscription(self, request, data):
        request.reject(405)

    def incoming_referral(self, request, data):
        request.reject(405)

    def incoming_message(self, request, data):
        request.reject(405)
示例#2
0
 def __init__(self):
     self.web_handler = WebHandler()
     self.admin_web_handler = AdminWebHandler()