Module number_analysis

Central module for routing.

Behaviour: gen_server.

Description

Central module for routing. All phones are registered here. Creation of new processes in a call chain is preformed by this module.

Data Types

anumber_table_entry()

anumber_table_entry() = {Prefix::string(), Min::integer(), Max::integer(), {TableNumber::integer, Action::atable_action()}}

anumber_table_printout()

anumber_table_printout() = [anumber_table_entry()]

bnumber_table_printout()

bnumber_table_printout() = [bnumber_table_entry()]

nature_of_address()

nature_of_address() = atom()

number_table_printout()

number_table_printout() = {{anumber_table, anumber_table_printout()} | {bnumber_table, bnumber_table_printout()}}

process_type()

process_type() = atom()

trigger_data()

trigger_data() = {dynamic, process_type(), term()} | {static, process_type(), pid()} | {tree, integer()}

Function Index

add_phone/2Adds a phone number to the number analysis.
add_to_atable/4
add_to_btable/7Adds a number or range to the number analysis.
add_trigger_to_number/3
delete_from_atable/4
delete_from_btable/6
delete_phone/1Removes a phone number from the number analysis.
delete_trigger/3
get_all_phones/0Returns the numbers and controlling processes for all phones known to the number analysis.
get_phone_process/1Returns the process that handles the phone with the given number.
get_phone_spec/1
get_process/5Returns a process to which messages from the given A-number to the given B-number should be routed.
get_user_data/1
load_phone_specs/1
pp_number_analysis/1
pp_phones/1
print/0Returns the current number analysis tables.
reload_user_data/0
save_phone_specs/1
set_phone_spec/2
start_link/0Starts the server.

Function Details

add_phone/2

add_phone(Number::string(), Process::pid()) -> ok

Adds a phone number to the number analysis. The number is interpreted as an international number.

add_to_atable/4

add_to_atable(Number, MinLength, MaxLength, TreeId) -> term()

add_to_btable/7

add_to_btable(TreeId::integer(), NatureOfAddress::nature_of_address(), Number::string(), FWCounter::integer(), MinLength::integer(), MaxLength::integer(), TriggerData::trigger_data()) -> ok

Adds a number or range to the number analysis.

add_trigger_to_number/3

add_trigger_to_number(Number, Pid, Msg) -> term()

delete_from_atable/4

delete_from_atable(Number, MinLength, MaxLength, TreeId) -> term()

delete_from_btable/6

delete_from_btable(TreeId, NatureOfAddress, Number, FWCounter, MinLength, MaxLength) -> term()

delete_phone/1

delete_phone(Number::string) -> ok

Removes a phone number from the number analysis.

delete_trigger/3

delete_trigger(Number, Pid, Msg) -> term()

get_all_phones/0

get_all_phones() -> [{Number::string(), Process::pid()}]

Returns the numbers and controlling processes for all phones known to the number analysis.

get_phone_process/1

get_phone_process(Number::string()) -> {ok, Pid::pid()} | not_found

Returns the process that handles the phone with the given number.

get_phone_spec/1

get_phone_spec(Number) -> term()

get_process/5

get_process(BNumber::called_party_number(), ANumber::string(), IncomingProcess::pid(), IncomingType::process_type(), ForwardCounter::integer()) -> pid()

Returns a process to which messages from the given A-number to the given B-number should be routed. The incoming process and its type are provided to the new process. Depending on the data in the number analysis, an existing process is returned (static) or a new process is created (dynamic).

get_user_data/1

get_user_data(Number) -> term()

load_phone_specs/1

load_phone_specs(FileName) -> term()

pp_number_analysis/1

pp_number_analysis(X1) -> term()

pp_phones/1

pp_phones(X1) -> term()

print/0

print() -> number_table_printout()

Returns the current number analysis tables.

reload_user_data/0

reload_user_data() -> term()

save_phone_specs/1

save_phone_specs(FileName) -> term()

set_phone_spec/2

set_phone_spec(Number, Spec) -> term()

start_link/0

start_link() -> {ok, Process::pid()}

Starts the server.