CCO: TCAP 'Invoke' parameters are not OPTIONAL

... so we cannot feed asn1_NOVALUE into the encoder, but have to
pass an empty list instead. sigh.
This commit is contained in:
Harald Welte 2013-06-10 09:00:51 +02:00
parent f319881540
commit 0637b91934
1 changed files with 8 additions and 1 deletions

View File

@ -277,12 +277,19 @@ terminate_ISMs([{_Id, ISM}|Tail]) ->
gen_fsm:send_event(ISM, terminate),
terminate_ISMs(Tail).
undef2empty(undefined) ->
[];
undef2empty(asn1_NOVALUE) ->
[];
undef2empty(Foo) ->
Foo.
% 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_to_asn_rec(Uprim#'TC-INVOKE'.invokeID),
linkedId = inv_id_to_asn_rec(Uprim#'TC-INVOKE'.linkedID),
opcode = osmo_util:asn_val(Uprim#'TC-INVOKE'.operation),
argument = osmo_util:asn_val(Uprim#'TC-INVOKE'.parameters)}};
argument = undef2empty(Uprim#'TC-INVOKE'.parameters)}};
uprim_to_asn_rec(#'TC-RESULT-NL'{invokeID = InvId, operation = Op,
parameters = Params}) ->
ResRes = #'ReturnResult_result'{opcode = osmo_util:asn_val(Op),