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