예제 #1
0
def given_the_switchboard_is_configured_for_ldap_lookup_with_location(step):
    context_helper.add_or_replace_context('__switchboard_directory', 'Switchboard', 'internal')
    step.given('Given the LDAP server is configured and active')
    ldap_action_webi.add_or_replace_ldap_server('openldap-dev', 'openldap-dev.lan-quebec.avencall.com')
    ldap_action_webi.add_or_replace_ldap_filter(
        name='openldap-dev',
        server='openldap-dev',
        base_dn='dc=lan-quebec,dc=avencall,dc=com',
        username='******',
        password='******',
        display_name=['cn', 'st'])

    directory_action_webi.add_or_replace_directory(
        'openldap',
        'ldapfilter://openldap-dev',
        'cn,telephoneNumber,st',
        '',
        {'name': 'cn',
         'number': 'telephoneNumber',
         'location': 'st'}
    )
    directory_action_webi.add_or_replace_display(
        'switchboard',
        [('Icon', 'status', ''),
         ('Name', 'name', '{db-name}'),
         ('Number', 'number_office', '{db-number}'),
         ('Location', '', '{db-location}')]
    )
    directory_action_webi.assign_filter_and_directories_to_context(
        '__switchboard_directory',
        'switchboard',
        ['openldap']
    )
예제 #2
0
def given_i_have_the_following_extensions(step):
    for context_data in step.hashes:
        context_helper.add_or_replace_context(context_data['name'],
                                              context_data['name'],
                                              ContextType.internal)
        context_helper.update_contextnumbers_user(context_data['name'],
                                                  context_data['numberbeg'],
                                                  context_data['numberend'])
예제 #3
0
def given_i_have_the_following_extensions(step):
    for context_data in step.hashes:
        context_helper.add_or_replace_context(context_data['name'],
                                              context_data['name'],
                                              ContextType.internal)
        context_helper.update_contextnumbers_user(context_data['name'],
                                                  context_data['numberbeg'],
                                                  context_data['numberend'])
예제 #4
0
def given_there_is_an_outcall_in_context_with_trunk(step, outcall_name, outcall_context, trunk_name):
    context_helper.add_or_replace_context(outcall_context, outcall_context, 'outcall')
    trunksip_helper.add_or_replace_trunksip(world.dummy_ip_address, trunk_name)
    trunk_id = trunksip_helper.find_trunksip_id_with_name(trunk_name)
    data = {'name': outcall_name,
            'context': outcall_context,
            'trunks': [trunk_id]}
    outcall_helper.add_or_replace_outcall(data)
예제 #5
0
def given_the_switchboard_is_configured_for_internal_directory_lookup(step):
    context_helper.add_or_replace_context('__switchboard_directory', 'Switchboard', 'internal')
    directory_action_webi.add_or_replace_directory(
        'xivodirswitchboard',
        'phonebook',
        'phonebook.firstname,phonebook.lastname,phonebook.displayname,phonebook.society,phonebooknumber.office.number',
        '',
        {'name': 'phonebook.displayname',
         'number': 'phonebooknumber.office.number',
         'mobile': 'phonebooknumber.mobile.number'}
    )
    directory_action_webi.add_or_replace_display(
        'switchboard',
        [('Icon', 'status', ''),
         ('Name', 'name', '{db-name}'),
         ('Number', 'number_office', '{db-number}'),
         ('Number', 'number_mobile', '{db-mobile}')]
    )
    directory_action_webi.assign_filter_and_directories_to_context(
        '__switchboard_directory',
        'switchboard',
        ['xivodirswitchboard']
    )
def given_the_switchboard_is_configured_for_internal_directory_lookup(step):
    context_helper.add_or_replace_context('__switchboard_directory', 'Switchboard', 'internal')
    directory_action_webi.add_or_replace_directory(
        'xivodirswitchboard',
        'http://localhost/service/ipbx/json.php/private/pbx_services/phonebook',
        'phonebook.firstname,phonebook.lastname,phonebook.displayname,phonebook.society,phonebooknumber.office.number',
        '',
        {'name': '{phonebook.displayname}',
         'number': '{phonebooknumber.office.number}',
         'mobile': '{phonebooknumber.mobile.number}'}
    )
    directory_action_webi.add_or_replace_display(
        'switchboard',
        [('Icon', 'status', ''),
         ('Name', 'name', 'name'),
         ('Number', 'number_office', 'number'),
         ('Number', 'number_mobile', 'mobile')]
    )
    directory_action_webi.assign_filter_and_directories_to_context(
        '__switchboard_directory',
        'switchboard',
        ['xivodirswitchboard']
    )
    sysutils.restart_service('xivo-dird')