Esempio n. 1
0
def given_there_are_contexts_with_infos(step):
    for context_data in step.hashes:
        if context_data['type'] == 'user':
            context_helper.update_contextnumbers_user(context_data['name'],
                                                      context_data['range_start'],
                                                      context_data['range_end'],
                                                      entity_name=context_data['entity_name'])
        elif context_data['type'] == 'group':
            context_helper.update_contextnumbers_group(context_data['name'],
                                                       context_data['range_start'],
                                                       context_data['range_end'],
                                                       entity_name=context_data['entity_name'])
        elif context_data['type'] == 'meetme':
            context_helper.update_contextnumbers_meetme(context_data['name'],
                                                        context_data['range_start'],
                                                        context_data['range_end'])
        elif context_data['type'] == 'incall':
            context_helper.update_contextnumbers_incall(context_data['name'],
                                                        context_data['range_start'],
                                                        context_data['range_end'],
                                                        entity_name=context_data['entity_name'],
                                                        didlength=context_data['didlength'])
        elif context_data['type'] == 'queue':
            context_helper.update_contextnumbers_queue(context_data['name'],
                                                       context_data['range_start'],
                                                       context_data['range_end'],
                                                       entity_name=context_data['entity_name'])
Esempio n. 2
0
def given_there_are_contexts_with_infos(step):
    for context_data in step.hashes:
        if context_data['type'] == 'user':
            context_helper.update_contextnumbers_user(
                context_data['name'],
                context_data['range_start'],
                context_data['range_end'],
                entity_name=context_data['entity_name'])
        elif context_data['type'] == 'group':
            context_helper.update_contextnumbers_group(
                context_data['name'],
                context_data['range_start'],
                context_data['range_end'],
                entity_name=context_data['entity_name'])
        elif context_data['type'] == 'meetme':
            context_helper.update_contextnumbers_meetme(
                context_data['name'], context_data['range_start'],
                context_data['range_end'])
        elif context_data['type'] == 'incall':
            context_helper.update_contextnumbers_incall(
                context_data['name'],
                context_data['range_start'],
                context_data['range_end'],
                entity_name=context_data['entity_name'],
                didlength=context_data['didlength'])
        elif context_data['type'] == 'queue':
            context_helper.update_contextnumbers_queue(
                context_data['name'],
                context_data['range_start'],
                context_data['range_end'],
                entity_name=context_data['entity_name'])
Esempio n. 3
0
def main():
    print 'Initializing ...'
    initialize()
    try:
        print 'Configuring WebService Access on XiVO'
        _create_webservices_access()

        print 'Configuring PostgreSQL on XiVO'
        _create_pgpass_on_remote_host()
        _allow_remote_access_to_pgsql()

        print 'Configuring RabbitMQ on XiVO'
        _allow_remote_access_to_rabbitmq()

        print 'Configuring xivo-agid on XiVO'
        _allow_agid_listen_on_all_interfaces()

        print 'Configuring Provd REST API on XiVO'
        _allow_provd_listen_on_all_interfaces()

        print 'Installing packages'
        _install_packages(['tcpflow'])

        print 'Installing chan_test (module for asterisk)'
        _install_chan_test()

        print 'Adding context'
        context_helper.update_contextnumbers_queue('statscenter', 5000, 5100)
        context_helper.update_contextnumbers_user('statscenter', 1000, 1100)
        context_helper.update_contextnumbers_user('default', 1000, 1999)
        context_helper.update_contextnumbers_group('default', 2000, 2999)
        context_helper.update_contextnumbers_queue('default', 3000, 3999)
        context_helper.update_contextnumbers_meetme('default', 4000, 4999)
        context_helper.update_contextnumbers_incall('from-extern', 1000, 4999, 4)

        print 'Restarting All XiVO Services'
        _xivo_service_restart_all()
    finally:
        deinitialize()
Esempio n. 4
0
def main():
    print 'Initializing ...'
    initialize()
    try:
        print 'Configuring WebService Access on XiVO'
        _create_webservices_access()

        print 'Configuring PostgreSQL on XiVO'
        _create_pgpass_on_remote_host()
        _allow_remote_access_to_pgsql()

        print 'Configuring RabbitMQ on XiVO'
        _allow_remote_access_to_rabbitmq()

        print 'Configuring Provd REST API on XiVO'
        _allow_provd_listen_on_all_interfaces()

        print 'Installing packages'
        _install_packages(['tcpflow'])

        print 'Installing chan_test (module for asterisk)'
        _install_chan_test()

        print 'Adding context'
        context_helper.update_contextnumbers_queue('statscenter', 5000, 5100)
        context_helper.update_contextnumbers_user('statscenter', 1000, 1100)
        context_helper.update_contextnumbers_user('default', 1000, 1999)
        context_helper.update_contextnumbers_group('default', 2000, 2999)
        context_helper.update_contextnumbers_queue('default', 3000, 3999)
        context_helper.update_contextnumbers_meetme('default', 4000, 4999)
        context_helper.update_contextnumbers_incall('from-extern', 1000, 4999,
                                                    4)

        print 'Restarting All XiVO Services'
        _xivo_service_restart_all()
    finally:
        deinitialize()
Esempio n. 5
0
def run(extra_config):
    logger.debug('Initializing ...')
    setup.setup_config(extra_config)
    setup.setup_logging()
    setup.setup_xivo_acceptance_config()
    setup.setup_ssh_client()
    setup.setup_ws()
    setup.setup_confd_client()
    setup.setup_xivo_configured()

    setup.setup_browser()
    try:
        logger.debug('Configuring WebService Access on XiVO')
        _create_webservices_access()

        logger.debug('Configuring CA certificates')
        _configure_ca_certificates()

        logger.debug('Configuring Consul')
        _configure_consul()

        logger.debug('Configuring PostgreSQL on XiVO')
        _configure_postgresql()

        logger.debug('Configuring RabbitMQ on XiVO')
        _configure_rabbitmq()

        logger.debug('Configuring xivo-agid on XiVO')
        _allow_agid_listen_on_all_interfaces()

        logger.debug('Configuring Provd REST API on XiVO')
        _allow_provd_listen_on_all_interfaces()

        logger.debug('Installing packages')
        _install_packages(['tcpflow'])

        logger.debug('Installing chan_test (module for asterisk)')
        copy_asset_to_server('chan_test.so', '/usr/lib/asterisk/modules/chan_test.so')

        logger.debug('Adding context')
        context_helper.update_contextnumbers_queue('statscenter', 5000, 5100)
        context_helper.update_contextnumbers_user('statscenter', 1000, 1100)
        context_helper.update_contextnumbers_user('default', 1000, 1999)
        context_helper.update_contextnumbers_group('default', 2000, 2999)
        context_helper.update_contextnumbers_queue('default', 3000, 3999)
        context_helper.update_contextnumbers_meetme('default', 4000, 4999)
        context_helper.update_contextnumbers_incall('from-extern', 1000, 4999, 4)

        logger.debug('Configuring xivo-auth')
        _configure_xivo_auth()

        logger.debug('Configuring xivo-ctid')
        _configure_xivo_ctid()

        logger.debug('Configuring xivo-ctid-ng')
        _configure_xivo_ctid_ng()

        logger.debug('Allowing SIP usernames to change')
        _set_sip_usernames_read_write()
    finally:
        setup.teardown_browser()
 def _prepare_context(self):
     print 'Configuring Context..'
     context_helper.update_contextnumbers_user('default', 100, 199)
     context_helper.update_contextnumbers_incall('from-extern', 1000, 2000, 4)
Esempio n. 7
0
 def _prepare_context(self):
     print 'Configuring Context..'
     context_helper.update_contextnumbers_user('default', 100, 199)
     context_helper.update_contextnumbers_incall('from-extern', 1000, 2000,
                                                 4)