Always include AARE DialoguePDU if sending first END/CONTINUE

According to the spec regarding dialogue handling, the first
CONTINUE or END in response to a BEGIN must always contain a
dialogue portion with an AARE PDU, acknowledging protocol version and
application context name.
This commit is contained in:
Harald Welte 2013-06-09 22:13:41 +02:00
parent 0a00ca8a20
commit 1e7edddd7f
1 changed files with 14 additions and 27 deletions

View File

@ -264,22 +264,16 @@ idle({'TR', 'BEGIN', indication, BeginParms}, State) when is_record(BeginParms,
%%% TC-CONTINUE request from TCU
initiation_received({'TC', 'CONTINUE', request, ContParms}, State) when is_record(ContParms, 'TC-CONTINUE') ->
%% Dialogue info included?
case ContParms#'TC-CONTINUE'.userInfo of
UserInfo when is_binary(UserInfo) ->
AARE = #'AARE-apdu'{'protocol-version' = [version1],
'application-context-name' = ContParms#'TC-CONTINUE'.appContextName,
result = accepted,
'result-source-diagnostic' = {'dialogue-service-user', null},
'user-information' = UserInfo},
'user-information' = osmo_util:asn_val(ContParms#'TC-CONTINUE'.userInfo)},
{ok, DlgPor} = 'DialoguePDUs':encode('AARE-apdu', AARE),
DialoguePortion = dialogue_ext(DlgPor);
undefined ->
DialoguePortion = asn1_NOVALUE
end,
TrParms = #'TR-CONTINUE'{qos = ContParms#'TC-CONTINUE'.qos,
origAddress = ContParms#'TR-CONTINUE'.origAddress,
transactionID = State#state.otid,
userData = #'TR-user-data'{dialoguePortion = dialogue_ext(DialoguePortion)}},
userData = #'TR-user-data'{dialoguePortion = dialogue_ext(DlgPor)}},
NewState = State#state{parms = TrParms},
{next_state, wait_cont_components_ir, NewState};
@ -300,23 +294,16 @@ initiation_received({'TC', 'END', request, EndParms}, State) when is_record(EndP
%% Free dialogue ID
{stop, normal, NewState};
basic ->
%% Dialogue info included?
case EndParms#'TC-END'.userInfo of
UserInfo when is_list(UserInfo) ->
AARE = #'AARE-apdu'{'protocol-version' = [version1],
'application-context-name' = EndParms#'TC-END'.appContextName,
result = accepted,
'result-source-diagnostic' = {'dialogue-service-user', null},
'user-information' = UserInfo},
'user-information' = osmo_util:asn_val(EndParms#'TC-END'.userInfo)},
{ok, DlgPor} = 'DialoguePDUs':encode('AARE-apdu', AARE),
DialoguePortion = dialogue_ext(DlgPor);
undefined ->
DialoguePortion = asn1_NOVALUE
end,
TrParms = #'TR-END'{qos = EndParms#'TC-END'.qos,
transactionID = State#state.otid,
termination = EndParms#'TC-END'.termination,
userData = #'TR-user-data'{dialoguePortion = DialoguePortion}},
userData = #'TR-user-data'{dialoguePortion = dialogue_ext(DlgPor)}},
NewState = State#state{parms = TrParms},
%% Request components to CHA
gen_server:cast(NewState#state.cco, 'request-components'),