allow users to bind to a subsystem number on all local point codes
binding to {SSN,undefined} basically corresponds to binding to a UDP port with INADDR_ANY.
This commit is contained in:
parent
ab61a4ec38
commit
ab725b5cc7
|
@ -56,6 +56,10 @@ init(_Arg) ->
|
||||||
|
|
||||||
% client side code
|
% client side code
|
||||||
|
|
||||||
|
bind_ssn(Ssn) when is_integer(Ssn) ->
|
||||||
|
gen_server:call(?MODULE, {bind_ssn, Ssn, undefined}).
|
||||||
|
bind_ssn(Ssn, undefined) when is_integer(Ssn) ->
|
||||||
|
gen_server:call(?MODULE, {bind_ssn, Ssn, undefined});
|
||||||
bind_ssn(Ssn, Pc) when is_integer(Ssn), is_integer(Pc) ->
|
bind_ssn(Ssn, Pc) when is_integer(Ssn), is_integer(Pc) ->
|
||||||
gen_server:call(?MODULE, {bind_ssn, Ssn, Pc});
|
gen_server:call(?MODULE, {bind_ssn, Ssn, Pc});
|
||||||
bind_ssn(Ssn, Pc) when is_integer(Ssn), is_tuple(Pc) ->
|
bind_ssn(Ssn, Pc) when is_integer(Ssn), is_tuple(Pc) ->
|
||||||
|
@ -76,7 +80,13 @@ pid_for_ssn(Ssn, Pc) when is_integer(Ssn), is_integer(Pc) ->
|
||||||
[#scu_record{user_pid = UserPid}] ->
|
[#scu_record{user_pid = UserPid}] ->
|
||||||
{ok, UserPid};
|
{ok, UserPid};
|
||||||
_ ->
|
_ ->
|
||||||
{error, no_such_ssn}
|
% check if somebody has bound a SSN to all point codes
|
||||||
|
case ets:lookup(sccp_user_tbl, {Ssn, undefined}) of
|
||||||
|
[#scu_record{user_pid = UserPid}] ->
|
||||||
|
{ok, UserPid};
|
||||||
|
_ ->
|
||||||
|
{error, no_such_ssn}
|
||||||
|
end
|
||||||
end;
|
end;
|
||||||
pid_for_ssn(Ssn, Pc) when is_integer(Ssn), is_tuple(Pc) ->
|
pid_for_ssn(Ssn, Pc) when is_integer(Ssn), is_tuple(Pc) ->
|
||||||
PcInt = osmo_util:pointcode2int(Pc),
|
PcInt = osmo_util:pointcode2int(Pc),
|
||||||
|
|
Loading…
Reference in New Issue