CCO: handle 'dialogue-terminated' gracefully

This commit is contained in:
Harald Welte 2012-01-30 23:35:21 +01:00
parent f43bffe405
commit c956b44d97
1 changed files with 8 additions and 1 deletions

View File

@ -122,8 +122,9 @@ handle_cast('dialogue-terminated', State) ->
% * automatically released
% if any ISM active, terminate ISM
% * ISMs are linked, they should terminate
terminate_ISMs(State#state.ism),
% terminate
{stop, dialogue_terminated, State};
{stop, normal, State};
% from TCL -> CHA (CCO): TC-RESULT-{L,NL}, U-ERROR
handle_cast({'TC', Req, request, Param}, State) when
@ -277,6 +278,12 @@ terminate_active_ISM(ISMs, InvId) ->
ISMs
end.
terminate_ISMs([]) ->
ok;
terminate_ISMs([{_Id, ISM}|Tail]) ->
gen_fsm:send_event(ISM, terminate),
terminate_ISMs(Tail).
% Convert from user-visible primitive records to asn1ct-generated record
uprim_to_asn_rec(Uprim) when is_record(Uprim, 'TC-INVOKE') ->
{invoke, #'Invoke'{invokeId = inv_id(Uprim#'TC-INVOKE'.invokeID),