Mapping Custom MDCs
A common use case for mapping a custom MATRIXX Data Container (MDC) is to extend the Mtx5GMsg
MDC
and some MDCs within it, for example, Mtx5GMultiUnitUsageData
. A subtype
notation which involves adding the type name of a field after the field name, separated by an
exclamation mark enables this kind of mapping.
YAML key mismatches are avoided by using placeholder properties. These are properties defined within the mapping configuration for each MDC handler that allow placeholders within the mapping configuration file to be replaced with values when they are loaded. The default configuration defines a number of these placeholders where the subtype would normally be specified.
For example, the default configuration defines subtypes for some MDC fields (including the ! character) but leaves others empty:
mdc:
handlers:
chargingData:
mapping:
requestMappingFile: ChargingDataRequest-5230-mapping.yaml
responseMappingFile: ChargingDataResponse-5230-mapping.yaml
placeholderProperties:
mtx5gMsgType: ""
mtx5gRequestType: "!Mtx5GChargingDataRequest"
mtx5gResponseType: "!Mtx5GChargingDataResponse"
mtx5gMultiUnitUsageArrayType: ""
mtx5gUsedUnitContainerArrayType: ""
mtx5gPduSessionChargingInfoType: ""
The default OOTB mapping configuration uses these placeholders:
fieldMappings:
Mtx5GMsg${mtx5gMsgType}:
Request${mtx5gRequestType}:
InvocationSequenceNumber: "ChargingDataRequest.invocationSequenceNumber"
InvocationTimestamp: "ChargingDataRequest.invocationTimeStamp"
MultiUnitUsageArray${mtx5gMultiUnitUsageArrayType}:
RatingGroup: "ChargingDataRequest.multipleUnitUsage.ratingGroup"
When loaded, the following replacements are made:
fieldMappings:
Mtx5GMsg:
Request!Mtx5GChargingDataRequest:
InvocationSequenceNumber: "ChargingDataRequest.invocationSequenceNumber"
InvocationTimestamp: "ChargingDataRequest.invocationTimeStamp"
MultiUnitUsageArray:
RatingGroup: "ChargingDataRequest.multipleUnitUsage.ratingGroup"
To use custom MDCs to add types with their own fields, set the types in the property placeholders:
mdc:
handlers:
chargingData:
mapping:
placeholderProperties:
mtx5gMsgType: "!Cust5GMsg"
mtx5gRequestType: "!Cust5GChargingDataRequest"
mtx5gResponseType: "!Cust5GChargingDataResponse"
mtx5gMultiUnitUsageArrayType: "!Cust5GMultiUnitUsageData"
You can then customize the mapping while continuing to use the YAML keys with the placeholders:
baseFile: ${current.directory}/base/ChargingDataRequest-5230-mapping.yaml
fieldMappings:
Mtx5GMsg${mtx5gMsgType}:
Request${mtx5gRequestType}:
VoiceInformation:
BParty: "ChargingDataRequest.VoiceInformation.BParty"
MscAddress: "ChargingDataRequest.VoiceInformation.MscAddress"
TextInformation:
BParty: "ChargingDataRequest.TextInformation.BParty"
MscAddress: "ChargingDataRequest.TextInformation.MscAddress"
TraceFlag: "ChargingDataRequest.TraceFlag"
For more information about how to perform this mapping, see the discussion about Dynamic Message Mapper sub types in MATRIXX 5G Integration.
For a list of REST URIs and the associated mapping files for incoming messages, or for a list of MDCs and their associated mapping files for outgoing messages, see the discussion about API for 5G integration in MATRIXX 5G Integration.