aboutsummaryrefslogtreecommitdiffstats
path: root/lib/megaco/examples/simple/megaco_simple_mgc.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/megaco/examples/simple/megaco_simple_mgc.erl')
-rw-r--r--lib/megaco/examples/simple/megaco_simple_mgc.erl19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/megaco/examples/simple/megaco_simple_mgc.erl b/lib/megaco/examples/simple/megaco_simple_mgc.erl
index f324e17a3a..8a78262b86 100644
--- a/lib/megaco/examples/simple/megaco_simple_mgc.erl
+++ b/lib/megaco/examples/simple/megaco_simple_mgc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2019. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -193,15 +193,17 @@ stop(Mid) ->
d("stop -> entry with~n Mid: ~p", [Mid]),
Disco = fun(CH) ->
d("stop -> CH: ~p", [CH]),
- Reason = stopped_by_user,
- Pid = megaco:conn_info(CH, control_pid),
- SendMod = megaco:conn_info(CH, send_mod),
+ Reason = stopped_by_user,
+ Pid = megaco:conn_info(CH, control_pid),
+ SendMod = megaco:conn_info(CH, send_mod),
SendHandle = megaco:conn_info(CH, send_handle),
d("stop -> disconnect", []),
megaco:disconnect(CH, Reason),
+
d("stop -> cancel", []),
- megaco:cancel(CH, Reason),
+ megaco:cancel(CH, Reason), % see handle_disconnect
+
d("stop -> close transport"
"~n SendMod: ~p"
"~n SendHandle: ~p", [SendMod, SendHandle]),
@@ -247,6 +249,7 @@ handle_disconnect(ConnHandle, ProtocolVersion, Reason) ->
"~n ProtocolVersion: ~p"
"~n Reason: ~p"
"", [ConnHandle, ProtocolVersion, Reason]),
+ info_msg("handle_disconnect - cancel outstanding messages~n"),
megaco:cancel(ConnHandle, Reason), % Cancel the outstanding messages
ok.
@@ -443,6 +446,12 @@ get_arg(Key, Args) ->
%% DEBUGGING
%%----------------------------------------------------------------------
+info_msg(F) ->
+ info_msg(F, []).
+info_msg(F, A) ->
+ io:format("~p MGC: " ++ F ++ "~n", [self()|A]).
+
+
d(F) ->
d(F, []).