Esempio n. 1
0
# -*- coding: utf-8 -*-
from januscloud.common.error import JanusCloudError, JANUS_ERROR_NOT_IMPLEMENTED
from januscloud.common.schema import Schema, StrVal, Default, AutoDel, Optional, BoolVal, IntVal, \
    StrRe, EnumVal, Or, DoNotCare
from januscloud.common.confparser import parse as parse_config
import os

config_schema = Schema({
    Optional("general"):
    Default(
        {
            Optional("daemonize"): Default(BoolVal(), default=False),
            AutoDel(str): object  # for all other key remove
        },
        default={}),
    Optional("log"):
    Default(
        {
            Optional('log_to_stdout'):
            Default(BoolVal(), default=True),
            Optional('log_to_file'):
            Default(StrVal(), default=''),
            Optional('debug_level'):
            Default(EnumVal(['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL']),
                    default='DEBUG'),
            Optional('log_file_size'):
            Default(IntVal(), default=104857600),
            Optional('log_file_rotate'):
            Default(IntVal(), default=10),
            AutoDel(str):
            object  # for all other key remove
Esempio n. 2
0
# -*- coding: utf-8 -*-

from januscloud.common.schema import Schema, StrVal, Default, AutoDel, Optional, BoolVal, IntVal, \
    StrRe, EnumVal, Or
from januscloud.common.confparser import parse as parse_config
from pkg_resources import Requirement, resource_filename
import os

config_schema = Schema({
    Optional("general"): Default({
        Optional("daemonize"): Default(BoolVal(), default=False),
        Optional("configs_folder"): Default(StrVal(), default=''),
        Optional("server_name"): Default(StrRe(r'^\S*$'), default=''),
        Optional("session_timeout"): Default(IntVal(min=0, max=86400), default=60),
        Optional("server_db"): Default(StrVal(), default='memory'),
        Optional("server_select"): Default(StrVal(), default='rr'),
        Optional('api_secret'): Default(StrVal(), default=''),
        AutoDel(str): object  # for all other key we don't care
    }, default={}),
    Optional("log"): Default({
        Optional('log_to_stdout'): Default(BoolVal(), default=True),
        Optional('log_to_file'): Default(StrVal(), default=''),
        Optional('debug_level'): Default(EnumVal(['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL']), default='DEBUG'),
        Optional('log_file_size'): Default(IntVal(), default=104857600),
        Optional('log_file_rotate'): Default(IntVal(), default=10),
        AutoDel(str): object  # for all other key we don't care
    }, default={}),
    Optional("certificates"): Default({
        Optional("cert_pem"): StrVal(),
        Optional("cert_key"): StrVal(),
        Optional("cert_pwd"): StrVal(),
Esempio n. 3
0
                              JANUS_VIDEOCALL_API_SYNC_VERSION
JANUS_VIDEOCALL_NAME = 'JANUS VideoCall plugin'
JANUS_VIDEOCALL_AUTHOR = 'opensight.cn'
JANUS_VIDEOCALL_PACKAGE = 'janus.plugin.videocall'

JANUS_VIDEOCALL_API_BASE_PATH = '/plugins/videocall'

INCOMMING_CALL_TIMEOUT = 10

username_schema = Schema({
    'username': StrRe('^\w{1,128}$'),
    DoNotCare(str): object  # for all other key we don't care
})

set_schema = Schema({
    Optional('audio'): BoolVal(),
    Optional('video'): BoolVal(),
    Optional('bitrate'): IntVal(min=1),
    Optional('record'): BoolVal(),
    Optional('restart'): BoolVal(),
    Optional('filename'): StrVal(),
    Optional('substream'): IntVal(min=0, max=2),
    Optional('temporal'): IntVal(min=0, max=2),
    Optional('fallback'): IntVal(min=0),
    AutoDel(str): object  # for all other key we must delete
})

post_videocall_user_schema = Schema({
    'caller_username':
    StrRe('^\w{1, 128}$'),
    'backend_server_url':
Esempio n. 4
0
from januscloud.common.schema import Schema, StrVal, Default, AutoDel, Optional, BoolVal, IntVal, \
    StrRe, EnumVal, Or
from januscloud.common.confparser import parse as parse_config
from pkg_resources import Requirement, resource_filename
import os
import logging

log = logging.getLogger(__name__)

config_schema = Schema({
    Optional("general"):
    Default(
        {
            Optional("daemonize"):
            Default(BoolVal(), default=False),
            Optional("configs_folder"):
            Default(StrVal(), default=''),
            Optional("server_name"):
            Default(StrRe(r'^\S*$'), default=''),
            Optional("session_timeout"):
            Default(IntVal(min=0, max=86400), default=60),
            Optional("server_db"):
            Default(StrVal(), default='memory'),
            Optional("server_select"):
            Default(StrVal(), default='rr'),
            Optional('api_secret'):
            Default(StrVal(), default=''),
            AutoDel(str):
            object  # for all other key we don't care
        },