aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sccp_links.erl6
-rw-r--r--src/sccp_user.erl4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/sccp_links.erl b/src/sccp_links.erl
index 6b81b9f..fc44a7b 100644
--- a/src/sccp_links.erl
+++ b/src/sccp_links.erl
@@ -114,9 +114,10 @@ handle_call({register_linkset, {LocalPc, RemotePc, Name}},
false ->
{reply, {error, ets_insert}, S};
_ ->
- % FIXME: We need to trap the user Pid for EXIT
+ % We need to trap the user Pid for EXIT
% in order to automatically remove any links/linksets if
% the user process dies
+ link(FromPid),
{reply, ok, S}
end;
@@ -137,9 +138,10 @@ handle_call({register_link, {LsName, Sls, Name}},
false ->
{reply, {error, link_exists}, S};
_ ->
- % FIXME: We need to trap the user Pid for EXIT
+ % We need to trap the user Pid for EXIT
% in order to automatically remove any links if
% the user process dies
+ link(FromPid),
{reply, ok, S}
end;
_ ->
diff --git a/src/sccp_user.erl b/src/sccp_user.erl
index ccf413b..856d8d6 100644
--- a/src/sccp_user.erl
+++ b/src/sccp_user.erl
@@ -90,6 +90,10 @@ handle_call({bind_ssn, Ssn, Pc}, {FromPid, _FromRef}, S) ->
false ->
{reply, {error, ets_insert}, S};
Error ->
+ % We need to trap the user Pid for EXIT
+ % in order to automatically remove any SSN if
+ % the user process dies
+ link(FromPid),
{reply, ok, S}
end;