Configuring CHF

The CHF configuration overrides some properties defined in gateway.yaml but only for this particular network function (CHF).

CHF Configuration Example

The following configuration example shows CHF configuration in the nf.yaml file.

Note: In your nf.yaml file, only supply the properties explicitly changed from defaults for your deployment.
gateway:
  # Specify the external URL to access this network function. May be used by network functions to publish the external URI.
  externalUri: https://chf:9099
  # Network function instance id (UUID). Used if registering with an NRF.
  nfInstanceId: 8fad7ed6-e911-4d97-a60c-71c37acff499
  # Network function type (e.g. CHF)
  nfType: CHF
  specifications:
    names: TS32291_Nchf_ConvergedCharging.yaml,TS29594_Nchf_SpendingLimitControl.yaml
 
  # Definition of Application Errors and the fields that make up the ProblemDetails message that will be returned
  errors:
 
    # Nchf_ConvergedCharging specific application errors (3GPP TS 32.291 table 6.1.7.3-1)
 
    # The HTTP request is rejected because the set of session or subscriber information needed by the CHF for charging or CDR
    # creation is incomplete or erroneous or not available. (E.g. Rating Group, subscriber information)
    CHARGING_FAILED:
      type: "/errors/charging-failed"
      title: "Charging Failed"
      status: 400 #BadRequest
 
    # The HTTP request is rejected because the end user specified in the request cannot be served by the CHF.
    USER_UNKNOWN:
      type: "/errors/user-unknown"
      title: "User Unknown"
      status: 404 #NotFound
 
    # The HTTP request denied by the CHF due to restrictions or limitations related to the end-user.
    END_USER_REQUEST_DENIED:
      type: "/errors/end-user-request-denied"
      title: "End User Request Denied"
      status: 403 #Forbidden
 
    # The HTTP request denied by the CHF because the end user's account could not cover the requested service. If the request contained used units they are deducted, if applicable.
    QUOTA_LIMIT_REACHED:
      type: "/errors/quota-limit-reached"
      title: "Quota Limit Reached"
      status: 403 #Forbidden
 
    # The HTTP request rejected by the CHF due to end-user restrictions or limitations.
    END_USER_REQUEST_REJECTED:
      type: "/errors/end-user-request-rejected"
      title: "End User Request Rejected"
      status: 403 #Forbidden
 
    # The HTTP request is rejected because the set of information needed by the NF Consumer (CTF) to report the usage is incomplete or erroneous or not available.
    RE_AUTHORIZATION_FAILED:
      type: "/errors/re-authorization-failed"
      title: "Re-Authorization Failed"
      status: 400 #BadRequest
 
 
    # Nchf_SpendingLimitControl specific application errors (3GPP TS 29.594 table 5.7.3-1) - Omitted USER_UNKNOWN as duplicated by Nchf_ConvergedCharging
 
    # There are no policy counters available for the subscriber at the CHF
    NO_AVAILABLE_POLICY_COUNTERS:
      type: "/errors/no-available-policy-counters"
      title: "No Available Policy Counters"
      status: 400 #BadRequest
 
    # The policy counter identifiers in the request are not known at the CHF
    UNKNOWN_POLICY_COUNTERS:
      type: "/errors/unknown-policy-counters"
      title: "Unknown Policy Counters"
      status: 400 #BadRequest
 
    # The subscriber specified in the request is not known at the CHF and the subscription cannot be created.
    USER_UNKNOWN_SPENDINGLIMIT:
      type: "/errors/user-unknown"
      title: "User Unknown"
      status: 400 #BadRequest
      cause: "USER_UNKNOWN"
 
  # override the application name for prometheus metrics
  monitoring:
    prometheus:
      applicationName: sba-5gc-networkfunctions-chf
 
jms:
  enabled: true
 
engine:
  # Is the functionality to connect to the Engine enabled?
  enabled: true
 
nf:
 
  endpoints:
 
    # Default Charging Data CREATE Endpoint
    chargingDataCreate:
      urls:
        - /nchf-convergedcharging/v2/chargingdata
        - /nchf-convergedcharging/v1/chargingdata
      httpMethods:
        - POST
      validationRules: []
      scope: nchf-convergedcharging
      messageType: CHARGING_DATA
      defaultOperation: CREATE
      locationHeader:
        pattern: ${gateway.externalUri}/nchf-convergedcharging/v2/chargingdata/%s/
        sendOnOneTimeEvent: true
 
    # Default Charging Data UPDATE Endpoint
    chargingDataUpdate:
      urls:
        - /nchf-convergedcharging/v2/chargingdata/:ChargingDataRef/update
        - /nchf-convergedcharging/v1/chargingdata/:ChargingDataRef/update
      httpMethods:
        - POST
      validationRules:
        - type: PATH_PARAM
          parameterName: ChargingDataRef
          required: true
          # regex: ^[0-9]*$ # numeric
      scope: nchf-convergedcharging
      messageType: CHARGING_DATA
      defaultOperation: UPDATE
 
    # Default Charging Data DELETE Endpoint
    chargingDataDelete:
      urls:
        - /nchf-convergedcharging/v2/chargingdata/:ChargingDataRef/release
        - /nchf-convergedcharging/v1/chargingdata/:ChargingDataRef/release
      httpMethods:
        - POST
      validationRules:
        - type: PATH_PARAM
          parameterName: ChargingDataRef
          required: true
          # regex: ^[0-9]*$ # numeric
      scope: nchf-convergedcharging
      messageType: CHARGING_DATA
      defaultOperation: DELETE
 
    # Default Spending Limit CREATE Endpoint
    spendingLimitCreate:
      urls:
        - /nchf-spendinglimitcontrol/v2/subscriptions
        - /nchf-spendinglimitcontrol/v1/subscriptions
      httpMethods:
        - POST
      validationRules: [ ]
      scope: nchf-spendinglimitcontrol
      messageType: SPENDING_LIMIT_CONTROL
      defaultOperation: CREATE
      locationHeader:
        pattern: ${gateway.externalUri}/nchf-spendinglimitcontrol/v2/subscriptions/%s
 
    # Default Spending Limit UPDATE Endpoint
    spendingLimitUpdate:
      urls:
        - /nchf-spendinglimitcontrol/v2/subscriptions/:subscriptionId
        - /nchf-spendinglimitcontrol/v1/subscriptions/:subscriptionId
      httpMethods:
        - PUT
      validationRules:
        - type: PATH_PARAM
          parameterName: subscriptionId
          required: true
          # regex: ^[0-9]*$ # numeric
      scope: nchf-spendinglimitcontrol
      messageType: SPENDING_LIMIT_CONTROL
      defaultOperation: UPDATE
 
    # Default Spending Limit DELETE Endpoint
    spendingLimitDelete:
      urls:
        - /nchf-spendinglimitcontrol/v2/subscriptions/:subscriptionId
        - /nchf-spendinglimitcontrol/v1/subscriptions/:subscriptionId
      httpMethods:
        - DELETE
      validationRules:
        - type: PATH_PARAM
          parameterName: subscriptionId
          required: true
          # regex: ^[0-9]*$ # numeric
      scope: nchf-spendinglimitcontrol
      messageType: SPENDING_LIMIT_CONTROL
      defaultOperation: DELETE
 
mdc:
  handlers:
 
    # Charging Data MDC Handler
    chargingData:
      endpoints:
        - chargingDataCreate
        - chargingDataUpdate
        - chargingDataDelete
      mapping:
        requestMappingFile: ChargingDataRequest-5230-mapping.yaml
        responseMappingFile: ChargingDataResponse-5230-mapping.yaml
        placeholderProperties:
          mtx5gMsgType: "" # e.g. '!Cust5GMsg'
          mtx5gRequestType: "!Mtx5GChargingDataRequest"
          mtx5gResponseType: "!Mtx5GChargingDataResponse"
          mtx5gMultiUnitUsageArrayType: ""
          mtx5gUsedUnitContainerArrayType: ""
          mtx5gPduSessionChargingInfoType: ""
        inputParameters: {}
      resultCodes:
 
        # Result = 0 (Successful Response)
        - engineResult: 0
          sbaResponse: SUCCESS
 
          # Result = 10 (MtxErr::BAD_DATA) unrecognized field values in the request message; unexpected or missing pricing
          #                                configuration (bad event type, bad notification type, bad quota profile, etc.); bad
          #                                ChargingDataRequest.invocationSequenceNumber; usage quantity is negative; invalid rating
          #                                quantity type; invalid or unfound scale basis in a rating formula
        - engineResult: 10
          sbaResponse: INVALID_MSG_FORMAT
 
          # Result = 10 (MtxErr::BAD_DATA)
          # ResultDetail = 48 (MtxErr::DET_DEVICE) Invalid Subscriber Identifier to identify usage device
        - engineResult: 10
          engineResultDetails: 48
          sbaResponse: USER_UNKNOWN
 
          # Result = 11 (MtxErr::NOT_FOUND) object not found; for example, session specified by sessionId is not found, device
          #                                 specified by supi is not found, device specified by supi is not associated with a
          #                                 subscriber, balance object not found
        - engineResult: 11
          sbaResponse: USER_UNKNOWN
 
          # Result = 11 (MtxErr::NOT_FOUND)
          # ResultDetail = 42 (MtxErr::DET_SESSION) if the requested session is not found (invalid session id)
        - engineResult: 11
          engineResultDetails: 42
          sbaResponse: CHARGING_FAILED
 
          # Result = 11 (MtxErr::NOT_FOUND)
          # ResultDetail = 46 (MtxErr::DET_SUBSCRIBER) failed to find the subscriber associated with the device
        - engineResult: 11
          engineResultDetails: 46
          sbaResponse: USER_UNKNOWN
 
          # Result = 11 (MtxErr::NOT_FOUND)
          # ResultDetail = 48 (MtxErr::DET_DEVICE) failed to find the device for the given supi or session id
        - engineResult: 11
          engineResultDetails: 48
          sbaResponse: USER_UNKNOWN
 
          # Result = 11 (MtxErr::NOT_FOUND)
          # ResultDetail = 55 (MtxErr::DET_POLICY_COUNTER) if the requested policy counters are unknown
        - engineResult: 11
          engineResultDetails: 55
          sbaResponse: CHARGING_FAILED
 
          # Result = 19 (MtxErr:DUPLICATE) duplicate invocation sequence number
        - engineResult: 19
          sbaResponse: CHARGING_FAILED
 
          # Result = 25 (MtxErr::EXCEPTION_CAUGHT) – caught unexpected exception
        - engineResult: 25
          sbaResponse: SYSTEM_FAILURE
 
          # Result = 26 (MtxErr::NO_MEMORY)
        - engineResult: 26
          sbaResponse: INSUFFICIENT_RESOURCES
 
          # Result = 28 (MtxErr::LOGIC_ERROR) internal unexpected errors like missing work order, unsupported message Op code,
          #                                   unfound balance template
        - engineResult: 28
          sbaResponse: SYSTEM_FAILURE
 
          # Result = 29 (MtxErr::FIELD_NOT_FOUND) normalizer cannot find a custom field, cannot find a custom field to copy from or to
        - engineResult: 29
          sbaResponse: SYSTEM_FAILURE
 
          # Result = 39 (MtxErr::SERVICE_DENIED) attempting usage before the provisioned time of a device, no applicable offers to
          #                                      perform rating
        - engineResult: 39
          sbaResponse: END_USER_REQUEST_DENIED
 
          # Result = 79 (MtxErr::SUB_DOMAIN_TEMPORARILY_UNAVAILABLE) Sub-domain temporarily unavailable- please try again
        - engineResult: 79
          sbaResponse: SERVICE_UNAVAILABLE
 
    # Spending Limit Control MDC Handler
    spendingLimitControl:
      endpoints:
        - spendingLimitCreate
        - spendingLimitUpdate
        - spendingLimitDelete
      mapping:
        requestMappingFile: SpendingLimitRequest-5230-mapping.yaml
        responseMappingFile: SpendingLimitResponse-5230-mapping.yaml
        placeholderProperties:
          mtx5gMsgType: "" # e.g. '!Cust5GMsg'
          mtx5gRequestType: "!Mtx5GSpendingLimitRequest"
          mtx5gResponseType: "!Mtx5GSpendingLimitResponse"
        inputParameters: { }
      resultCodes:
 
        # Result = 0 (Successful Response)
        - engineResult: 0
          sbaResponse: SUCCESS
 
          # Result = 10 (MtxErr::BAD_DATA) unrecognized field values in the request message; unexpected or missing pricing
          #                                configuration (bad event type, bad notification type, bad quota profile, etc.); bad
          #                                ChargingDataRequest.invocationSequenceNumber; usage quantity is negative; invalid rating
          #                                quantity type; invalid or unfound scale basis in a rating formula
        - engineResult: 10
          sbaResponse: INVALID_MSG_FORMAT
 
          # Result = 10 (MtxErr::BAD_DATA)
          # ResultDetails = 42 (MtxErr:DET_SESSION)
        - engineResult: 10
          engineResultDetails: 42
          sbaResponse: MANDATORY_IE_INCORRECT
 
          # Result = 11 (MtxErr::NOT_FOUND) object not found; for example, session specified by sessionId is not found, device
          #                                 specified by supi is not found, device specified by supi is not associated with a
          #                                 subscriber, balance object not found
        - engineResult: 11
          sbaResponse: USER_UNKNOWN_SPENDINGLIMIT
 
          # Result = 11 (MtxErr::NOT_FOUND)
          # ResultDetail = 55 (MtxErr::DET_POLICY_COUNTER) if the requested policy counters are unknown
        - engineResult: 11
          engineResultDetails: 55
          sbaResponse: UNKNOWN_POLICY_COUNTERS
 
          # Result = 36 (MtxErr::NO_POLICY_COUNTERS): No policy counters are available when processing Spending Limit message
        - engineResult: 36
          sbaResponse: NO_AVAILABLE_POLICY_COUNTERS
 
          # Result = 79 (MtxErr::SUB_DOMAIN_TEMPORARILY_UNAVAILABLE) Sub-domain temporarily unavailable- please try again
        - engineResult: 79
          sbaResponse: SERVICE_UNAVAILABLE
 
  notifications:
    queueManagers:
      # Default Queue Manager
      defaultQueueManager:
        url: amqp://localhost:15672
        username: guest
        password: guest
        initRetryDelayMillis: 5000
 
    handlers:
 
      # Charging Data Notifications
      chargingDataNotifications:
        queueManager: defaultQueueManager
        requestQueue: chf_chargingdatanotify_request
        responseQueue: chf_chargingdatanotify_response
        consumers: 2
        auditNetworkConfirmations: true
        mdcMappings:
          Mtx5GChargingNotifyRequest:
            requestMappingFile: ChargingNotifyRequest-5230-mapping.yaml
            responseMappingFile: ChargingNotifyResponse-5230-mapping.yaml
            placeholderProperties:
              mtx5gMsgType: "" # e.g. '!Cust5GMsg'
              mtx5gRequestType: "!Mtx5GChargingNotifyRequest"
              mtx5gResponseType: "!Mtx5GChargingNotifyResponse"
              mtx5gRequestHeaderType: "!Mtx5GNotifyRequestHeader"
            inputParameters: { }
 
      # Spending Limit Notifications
      spendingLimitNotifications:
        queueManager: defaultQueueManager
        requestQueue: chf_spendinglimitnotify_request
        responseQueue: chf_spendinglimitnotify_response
        consumers: 2
        auditNetworkConfirmations: true
        mdcMappings:
          Mtx5GSpendingLimitNotifyRequest:
            requestMappingFile: SpendingLimitNotifyStatusRequest-5230-mapping.yaml
            responseMappingFile: SpendingLimitNotifyStatusResponse-5230-mapping.yaml
            placeholderProperties:
              mtx5gMsgType: "" # e.g. '!Cust5GMsg'
              mtx5gRequestType: "!Mtx5GSpendingLimitNotifyRequest"
              mtx5gResponseType: "!Mtx5GSpendingLimitNotifyResponse"
              mtx5gRequestHeaderType: "!Mtx5GNotifyRequestHeader"
            inputParameters: { }
          Mtx5GSubscriptionTerminationRequest:
            requestMappingFile: SpendingLimitNotifyTerminateRequest-5230-mapping.yaml
            responseMappingFile: SpendingLimitNotifyTerminateResponse-5230-mapping.yaml
            placeholderProperties:
              mtx5gMsgType: "" # e.g. '!Cust5GMsg'
              mtx5gRequestType: "!Mtx5GSubscriptionTerminationRequest"
              mtx5gResponseType: "!Mtx5GSubscriptionTerminationResponse"
              mtx5gRequestHeaderType: "!Mtx5GNotifyRequestHeader"
            inputParameters: { }

SBA Gateway Responses Configuration for One-Time Events

When a ChargingData Create request is sent, SBA Gateway normally returns a SessionID as part of a URI in the Location HTTP header section of the response. Responses for one-time events do not include a SessionId, because no update or release is expected. Use the nf.chf.chargingData.oneTimeEvent.sendLocationHeader option to control whether a location header containing a no-op URI is sent, or no Location header is sent, in response to a ChargingData Create request for a one-time event.

The default value for nf.chf.chargingData.oneTimeEvent.sendLocationHeader is true, causing a Location header containing a no-op URI to be sent.