def given_there_is_an_outcall_with_trunk_and_no_extensions_matched(step, outcall_name, trunk_name): 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': 'to-extern', 'trunks': [trunk_id]} outcall_helper.add_or_replace_outcall(data)
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)
def given_there_is_an_outcall_with_trunk_with_extension_patterns(step, outcall_name, trunk_name): trunksip_helper.add_or_replace_trunksip(world.dummy_ip_address, trunk_name) trunk_id = trunksip_helper.find_trunksip_id_with_name(trunk_name) extensions = [] for outcall_extension in step.hashes: new_extension = {} new_extension['exten'] = outcall_extension['extension_pattern'] new_extension['stripnum'] = outcall_extension.get('stripnum', 0) new_extension['caller_id'] = outcall_extension.get('caller_id', '') extensions.append(new_extension) data = {'name': outcall_name, 'context': 'to-extern', 'trunks': [trunk_id], 'extens': extensions} outcall_helper.add_or_replace_outcall(data)
def given_there_is_a_siptrunk_with_callerid(step, name, context): callgen_ip = socket.gethostbyname(world.config.callgen_host), trunksip_helper.add_or_replace_trunksip(callgen_ip, name, context)