TCAP SAP supervisor: make sure we correctly start behaviour module

start of a given TCO is done as follows:
{ok, Pid} = supervisor:start_child(tcap_sup, [[osmo_sccp_tcap, [7],[]]]).

where '7' is the SCCP sub-system number (SSN) to which TCAP should bind.
This commit is contained in:
Harald Welte 2011-12-13 19:18:52 +01:00
parent c569118a3a
commit 0dde0bd85f
1 changed files with 3 additions and 2 deletions

View File

@ -60,8 +60,9 @@
%% @see supervisor:init/1
%%
init([Module, Args, Options]) when is_list(Args), is_list(Options) ->
% Name = list_to_atom("tcap_ssn" ++ integer_to_list(SSN)),
StartArgs = [Module, [self()] ++ Args, Options],
SSN = hd(Args),
Name = list_to_atom("tcap_ssn" ++ integer_to_list(SSN)),
StartArgs = [{local, Name}, tcap_tco_server, [self(), Module, Args], Options],
StartFunc = {gen_server, start_link, StartArgs},
ChildSpec = {tco, StartFunc, permanent, 4000, worker, [Module, tcap_tco_server]},
{ok,{{one_for_one, 10, 60}, [ChildSpec]}}.