The ASN.1 encoder wants to explicitly have asn1_NOVALUE for OPTIONAL
fields. However, the default erlang record initializer is 'undefiend',
so we have to replace undefined with asn1_NOVALUE before feeding it to
asn1rt.
This introduces a new 'call' from the TC-User to TCO, which creates
the equired transaction_sup, dialogues_sup, dha_fsm and tsm_fsm _before_
the TC-INVOKE component will be passed into the new DHA fsm.
Once the TCO actually receives the TR-BEGIN, it will not start the
transaction supervisor, but merely look it up based on the TR-user
provided transaction ID.
The tcap_invocation_sup is cretaed at the same time the tcap_cco_server
is created. Once TR requests BEGIN components, the tcap_invocation_sup
is requested to start a new tcap_ism_fsm child.
Prior to this patch, DHA needs to know the CCO pid, and CCO needed to
know the DHA pid at startup. The idea was to start CCO from within the
init() callback in DHA. However, this caused a deadlock in the
supervisor.
We now use the locally registred process names (tcap_cco_DLGID) to
resolve the process. However, it might be cleaner to use an ets table
at some later point. For now it is nice to see the name of each process
in pman for debugging...
This can be used to instantiate the per-SAP tcap_sap_sup and
tcap_tco_server callback module in a simple call like this:
{ok, TcoPid} = tcap_user:start_sap(osmo_sccp_tcap, [7], []).
First of all, different SCCP implementations may have different names.
Secontly, the TCAP application can be started without SCCP. It's only
needed when the adaptor process between tcap_tco_server and SCCP is
created. This is an explicit action by the user anyway...
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.
results from the asn1 encoder are always prefixed with {ok, ..}
As the encoder returns binary data, the list_to_binary() function is
bogus. The result might be an iolist() - which we simply specify the
underlying SCCP transport implementation must support (or flatten
itself).