Exemplo n.º 1
0
def when_i_edit_voicemail_via_restapi(step, extension):
    parameters = _extract_voicemail_info_to_restapi(step.hashes[0])
    number, context = func.extract_number_and_context_from_extension(extension)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(
        number, context)
    world.response = voicemail_action_restapi.edit_voicemail(
        voicemail_id, parameters)
Exemplo n.º 2
0
def when_i_link_user_group1_with_voicemail_group2_via_restapi(
        step, fullname, voicemail):
    user = user_helper.find_user_by_name(fullname)
    number, context = func.extract_number_and_context_from_extension(voicemail)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(
        number, context)

    world.response = voicemail_link_action_restapi.link_voicemail(
        user.id, voicemail_id)
Exemplo n.º 3
0
def given_there_is_a_group_with_extension_and_users(step, name, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    group_helper.delete_groups_with_number(number)

    user_ids = []
    for info in step.hashes:
        user_id = user_helper.find_user_id_with_firstname_lastname(info['firstname'], info['lastname'])
        user_ids.append(user_id)

    group_helper.add_group(name, number, context, user_ids)
Exemplo n.º 4
0
def given_there_is_a_agent_in_context_with_number(step, firstname, lastname, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    agent_helper.delete_agents_with_number(number)
    agent_data = {
        'firstname': firstname,
        'lastname': lastname,
        'number': number,
        'context': context
    }
    agent_helper.add_agent(agent_data)
Exemplo n.º 5
0
def given_there_is_a_agent_in_context_with_number(step, firstname, lastname,
                                                  extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    agent_helper.delete_agents_with_number(number)
    agent_data = {
        'firstname': firstname,
        'lastname': lastname,
        'number': number,
        'context': context
    }
    agent_helper.add_agent(agent_data)
Exemplo n.º 6
0
def given_there_is_a_group_with_extension_and_users(step, name, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    group_helper.delete_groups_with_number(number)

    user_ids = []
    for info in step.hashes:
        user_id = user_helper.find_user_id_with_firstname_lastname(
            info['firstname'], info['lastname'])
        user_ids.append(user_id)

    group_helper.add_group(name, number, context, user_ids)
Exemplo n.º 7
0
def when_i_edit_voicemail_via_restapi(step, extension):
    parameters = _extract_voicemail_info_to_restapi(step.hashes[0])
    number, context = func.extract_number_and_context_from_extension(extension)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(number, context)
    world.response = voicemail_action_restapi.edit_voicemail(voicemail_id, parameters)
Exemplo n.º 8
0
def when_i_send_a_request_for_the_voicemail_with_number_group1_using_its_id(step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(number, context)
    world.response = voicemail_action_restapi.get_voicemail(voicemail_id)
Exemplo n.º 9
0
def when_chan_test_calls_with_id_calleridname_calleridnum(step, extension, channelid, calleridname, calleridnum):
    number, context = func.extract_number_and_context_from_extension(extension)
    cmd = "test newid %s %s %s %s %s" % (channelid, number, context, calleridnum, calleridname)
    asterisk_helper.send_to_asterisk_cli(cmd)
Exemplo n.º 10
0
def when_chan_test_calls(step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    cmd = 'test new %s %s' % (number, context)
    asterisk_helper.send_to_asterisk_cli(cmd)
Exemplo n.º 11
0
def find_with_extension(extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    return find_with_exten_context(number, context)
Exemplo n.º 12
0
def find_with_extension(extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    return find_with_exten_context(number, context)
Exemplo n.º 13
0
def when_i_delete_voicemail_with_number_group1_via_restapi(step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(
        number, context)
    world.response = voicemail_action_restapi.delete_voicemail(voicemail_id)
Exemplo n.º 14
0
def when_i_send_a_request_for_the_voicemail_with_number_group1_using_its_id(
        step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(
        number, context)
    world.response = voicemail_action_restapi.get_voicemail(voicemail_id)
Exemplo n.º 15
0
def when_i_delete_voicemail_with_number_group1_via_restapi(step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(number, context)
    world.response = voicemail_action_restapi.delete_voicemail(voicemail_id)
Exemplo n.º 16
0
def when_i_link_user_group1_with_voicemail_group2_via_restapi(step, fullname, voicemail):
    user = user_helper.find_user_by_name(fullname)
    number, context = func.extract_number_and_context_from_extension(voicemail)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(number, context)

    world.response = voicemail_link_action_restapi.link_voicemail(user.id, voicemail_id)
Exemplo n.º 17
0
def then_line_with_number_exists(step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    assert line_helper.is_with_exten_context_exists(number, context)
Exemplo n.º 18
0
def then_line_with_number_exists_with_password(step, extension, password):
    number, context = func.extract_number_and_context_from_extension(extension)
    line = line_helper.find_with_exten_context(number, context)
    assert line
    assert line.secret == password
Exemplo n.º 19
0
def then_i_see_rejected_call_in_asterisk_log(step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    expression = "to extension '%s' rejected because extension not found in context '%s'" % (number, context)
    assert search_str_in_asterisk_log(expression)
Exemplo n.º 20
0
def then_i_see_rejected_call_in_asterisk_log(step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    expression = "to extension '%s' rejected because extension not found in context '%s'" % (
        number, context)
    assert search_str_in_asterisk_log(expression)
Exemplo n.º 21
0
def when_chan_test_calls(step, extension):
    number, context = func.extract_number_and_context_from_extension(extension)
    cmd = "test new %s %s" % (number, context)
    asterisk_helper.send_to_asterisk_cli(cmd)
Exemplo n.º 22
0
def when_chan_test_calls_with_id_calleridname_calleridnum(
        step, extension, channelid, calleridname, calleridnum):
    number, context = func.extract_number_and_context_from_extension(extension)
    cmd = 'test newid %s %s %s %s %s' % (channelid, number, context,
                                         calleridnum, calleridname)
    asterisk_helper.send_to_asterisk_cli(cmd)
Exemplo n.º 23
0
def when_i_associate_a_fake_user_with_with_voicemail_group1_via_confd(step, voicemail):
    number, context = func.extract_number_and_context_from_extension(voicemail)
    voicemail_id = voicemail_helper.find_voicemail_id_with_number(number, context)

    world.response = voicemail_link_action_confd.link_voicemail(FAKE_ID, voicemail_id)