Esempio n. 1
0
def set_context_outcall(context, entity):
    Session.add(
        Context(name='to-extern',
                displayname=context['display_name'],
                entity=entity,
                contexttype='outcall',
                description=''))
Esempio n. 2
0
def set_context_switchboard(entity):
    Session.add(
        Context(name='__switchboard_directory',
                displayname='Switchboard',
                entity=entity,
                contexttype='others',
                description=''))
Esempio n. 3
0
def associate_sccp_device(line, device):
    device_name = "SEP" + device.mac.replace(":", "").upper()

    sccpdevice = (Session.query(SCCPDevice).filter(
        SCCPDevice.device == device_name).first())

    if sccpdevice:
        sccpdevice.line = line.name
    else:
        Session.add(
            SCCPDevice(name=device_name, device=device_name, line=line.name))
    Session.flush()
Esempio n. 4
0
def set_resolvconf(hostname, domain, nameservers):
    row = Session.query(Resolvconf).first()
    row.hostname = hostname
    row.domain = domain
    row.search = domain
    row.description = 'Wizard Configuration'
    row.nameserver1 = nameservers[0]
    if len(nameservers) > 1:
        row.nameserver2 = nameservers[1]
        if len(nameservers) > 2:
            row.nameserver3 = nameservers[2]

    Session.add(row)
Esempio n. 5
0
def set_context_internal(context, entity):
    Session.add(
        Context(name='default',
                displayname=context['display_name'],
                entity=entity,
                contexttype='internal',
                description=''))

    Session.add(
        ContextNumbers(context='default',
                       type='user',
                       numberbeg=context['number_start'],
                       numberend=context['number_end']))
Esempio n. 6
0
def set_netiface(interface, address, netmask, gateway):
    Session.add(
        Netiface(ifname=interface,
                 hwtypeid=1,
                 networktype='voip',
                 type='iface',
                 family='inet',
                 method='static',
                 address=address,
                 netmask=netmask,
                 broadcast='',
                 gateway=gateway,
                 mtu=1500,
                 options='',
                 description='Wizard Configuration'))
Esempio n. 7
0
def set_context_incall(context, entity):
    Session.add(
        Context(name='from-extern',
                displayname=context['display_name'],
                entity=entity,
                contexttype='incall',
                description=''))

    if context.get('number_start') and context.get('number_end'):
        Session.add(
            ContextNumbers(context='from-extern',
                           type='incall',
                           numberbeg=context['number_start'],
                           numberend=context['number_end'],
                           didlength=context['did_length']))
Esempio n. 8
0
def set_language(language):

    row = Session.query(StaticSIP).filter(
        StaticSIP.var_name == 'language').first()
    row.var_val = language
    Session.add(row)

    row = Session.query(StaticIAX).filter(
        StaticIAX.var_name == 'language').first()
    row.var_val = language
    Session.add(row)

    row = (Session.query(SCCPGeneralSettings).filter(
        SCCPGeneralSettings.option_name == 'language').first())
    row.option_value = language
    Session.add(row)
Esempio n. 9
0
def set_xivo_configured():
    row = Session.query(General).first()
    row.configured = True
    Session.add(row)
Esempio n. 10
0
def set_timezone(timezone):
    row = Session.query(General).first()
    row.timezone = timezone
    Session.add(row)
Esempio n. 11
0
def set_default_entity(display_name, name):
    row = Entity(displayname=display_name,
                 name=name,
                 description='Wizard Entity')
    Session.add(row)
Esempio n. 12
0
def set_autoprov_name(autoprov_username):
    Session.add(
        StaticSIP(category='general',
                  filename='sip.conf',
                  var_name='autocreate_prefix',
                  var_val=autoprov_username))
Esempio n. 13
0
def set_admin_password(password):
    row = Session.query(User).filter(User.login == 'root').first()
    row.passwd = password
    Session.add(row)
Esempio n. 14
0
def include_outcall_context_in_internal_context():
    Session.add(
        ContextInclude(context='default', include='to-extern', priority=0))
Esempio n. 15
0
def update(provisioning_networking):
    Session.add(provisioning_networking)
    Session.flush()