From 77d0ee7b13fb33d27a0b6ab78787c7b08307d06b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 31 Jan 2012 21:28:24 +0100 Subject: [PATCH] CCO: properly convert InvokeID of received components --- TCAP/src/ITU/tcap_cco_server.erl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/TCAP/src/ITU/tcap_cco_server.erl b/TCAP/src/ITU/tcap_cco_server.erl index 610ee76..d8d3f6a 100644 --- a/TCAP/src/ITU/tcap_cco_server.erl +++ b/TCAP/src/ITU/tcap_cco_server.erl @@ -349,7 +349,8 @@ process_rx_components(ISMs, Usap, DlgId, [Head|Tail]) -> process_rx_component(ISMs, Usap, DlgId, Head), process_rx_components(ISMs, Usap, DlgId, Tail). -process_rx_component(ISMs, Usap, DlgId, C={invoke, #'Invoke'{invokeId=InvId}}) -> +process_rx_component(ISMs, Usap, DlgId, C={invoke, #'Invoke'{}}) -> + InvId = get_invoke_id_from_comp(C), {invoke, I} = C, case I#'Invoke'.linkedId of asn1_NOVALUE -> @@ -361,8 +362,8 @@ process_rx_component(ISMs, Usap, DlgId, C={invoke, #'Invoke'{invokeId=InvId}}) - end, Prim = asn_rec_to_uprim(C, DlgId), gen_fsm:send_event(Usap, {'TC','INVOKE',indication,Prim}); -process_rx_component(ISMs, _Usap, DlgId, C={reject, #'Reject'{invokeId=InvId, - problem=Problem}}) -> +process_rx_component(ISMs, _Usap, DlgId, C={reject, #'Reject'{problem=Problem}}) -> + InvId = get_invoke_id_from_comp(C), ISM = lists:keyfind(InvId, 1, ISMs), case Problem of {invoke, _} -> @@ -392,16 +393,16 @@ add_components_to_state(State, CompNew) when is_record(CompNew, component) -> % get the invokeId from the given asn-record component tuple. get_invoke_id_from_comp({invoke, #'Invoke'{invokeId = InvId}}) -> - InvId; + inv_id_to_uprim(InvId); get_invoke_id_from_comp({returnResult, #'ReturnResult'{invokeId = InvId}}) -> - InvId; + inv_id_to_uprim(InvId); get_invoke_id_from_comp({returnResultNotLast, #'ReturnResult'{invokeId = InvId}}) -> - InvId; + inv_id_to_uprim(InvId); get_invoke_id_from_comp({returnError, #'ReturnError'{invokeId = InvId}}) -> - InvId; + inv_id_to_uprim(InvId); get_invoke_id_from_comp({reject, #'Reject'{invokeId = InvId}}) -> - InvId. + inv_id_to_uprim(InvId).