From 9b5ea3e612c5c6caf2d4dd0855fdf285e39f9d6a Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 8 Dec 2011 14:09:34 +0100 Subject: ss7_links: add mtp3_tx/2 variant to trnasmit to given linkset this doesn't resolve the Linkset based on Dpc/SLS, but on the caller-specified linkset name. --- src/ss7_links.erl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ss7_links.erl b/src/ss7_links.erl index da6f790..e873db3 100644 --- a/src/ss7_links.erl +++ b/src/ss7_links.erl @@ -35,7 +35,8 @@ -export([register_link/3, unregister_link/2, set_link_state/3]). -export([bind_service/2, unbind_service/1]). --export([get_pid_for_link/2, get_pid_for_dpc_sls/2, mtp3_tx/1, +-export([get_pid_for_link/2, get_pid_for_dpc_sls/2, + mtp3_tx/1, mtp3_tx/2, get_linkset_for_dpc/1, get_opc_for_linkset/1, is_pc_local/1, get_user_pid_for_service/1, mtp3_rx/1, dump/0]). @@ -193,6 +194,20 @@ mtp3_rx(P = #primitive{parameters=#mtp3_msg{service_ind=Serv}}) -> end. +% transmit a MTP3 message via any of the avaliable links for the DPC +mtp3_tx(Mtp3 = #mtp3_msg{routing_label = RoutLbl}, Link) -> + #mtp3_routing_label{sig_link_sel = Sls} = RoutLbl, + % discover the link through which we shall send + case get_pid_for_link(Link, Sls) of + {error, Error} -> + {error, Error}; + {ok, Pid} -> + gen_server:cast(Pid, + osmo_util:make_prim('MTP', 'TRANSFER', + request, Mtp3)) + end. + + % transmit a MTP3 message via any of the avaliable links for the DPC mtp3_tx(Mtp3 = #mtp3_msg{routing_label = RoutLbl}) -> #mtp3_routing_label{dest_pc = Dpc, sig_link_sel = Sls} = RoutLbl, -- cgit v1.2.3