6 IWF Configuration
This section includes configuration options supported for IWF.
For detailed information about configuring parameters, see IWF Configurable Parameters.
Download the InterWorking and Mediation Function (IWF) Custom Template ZIP file
from OHC and Unzip the template to get ociwf-custom-values-1.5.0.yaml
file.
Mediation Test Mode configuration
IWF Mediation can be configured to send request and response to IWF Mediation Test
Service by setting test-mode-enable
to True
in environment variable in the IWF Mediation deployment chart.
MYSQL Configuration
The MYSQL allows the operator to configure the database and store the association between the N5 and Rx session.
- Configurable options supported through custom values
file
ociwf-custom-values-1.5.0.yaml
.- Using CNE Mysql cluster
- Edit
iwf-mysql:enabled
: false (Disables the mysql pod) - Edit
iwf-diameterproxy
:Enter the IP of the primary and secondary mysql nodes in the mysql cluster deployed in CNE.
dpDBService1: <db connectivity service name>
dpDBService2: <db connectivity service name>
Note:
Along with IP, the DB cluster credentials should be configured.
- Edit
- Using CNE Mysql cluster
Updating Mediation Rule in the ConfigMap
Reloading the IWF-Mediation ConfigMap, if in case any updates were made in the Rules.
The tool
ociwf-rule-download_tool.sh
can be used to download the rule configmap in a folder (folder name will be
configmap name). It needs namespace as well as required configmap name. These
rules then can be changed accordingly.
ociwf-rule-upload_tool.sh
can be used to upload the rule config map
from the existing config map folder. It needs namespace as well as required
configmap name to be uploaded.
- If rules were changed on iwf
active mediation, then use
ociwf-iwf-mediation-config-active
as the name of configmap. - If rules were changed on iwf
test mediation then use
ociwf-iwf-mediation-config-test
as the name of the configmap.
- The tool
ociwf-rule-download_tool.sh
can be used to download the rule configmap in a folder (folder name will be configmap name). It needs namespace as well as required configmap name. These rules then can be changed accordingly.
- The tool
ociwf-rule-upload_tool.sh
can be used to upload the rule config map from the existing config map folder. It needs namespace as well as required configmap name to be uploaded
- If rules were changed on nf active
mediation, then execute
ociwf-nf-mediation-config-active
as the name of configmap - If the rules were changed on nf test
mediation, then execute:
ociwf-nf-mediation-config-test
as the name of the configmap.Note:
The user can varify the status through container logs, Prometheus metrics or graffana dashboards.
IWF-Mediation Rule Configuration for PT
Add below rules to the mediation rules:
Note:
In the below rules, replacePCF_loadBalancerIP_and_Port
and
IWF_loadBalancerIP_and_Port
with appropriate values.
rule "pt_d2h_to_nf_rule"
salience 1
when
req : Request(headers.has("pt_dest_uri"))
then
req.setUri(req.headers.get("pt_dest_uri").replace("pcf.com","10.75.203.74:1000/simulation"))
req.headers.del("pt_dest_uri")
end
rule "pt_rar_to_pcf_rule"
salience 1
when
req : Request(req.getUri().toString() matches ".*(npcf-policyauthorization)*(v1)*(notification)*(notify).*")
then
req.getHttpMessageFactImpl().forwardPath = IWFConsts.FORWARD_TO_H2D
req.headers.add("diameterApplicationId","16777236")
req.headers.add("diameterCommandCode","258")
req.headers.add("original-req-uri",req.getUri())
end
rule "pt_aar_to_pcf_rule"
salience 1
when
req : Request(req.body.has("$.ascReqData.notifUri"))
then
req.body.add("$.ascReqData.notifUri",req.body.get("$.ascReqData.notifUri").toString().replace("iwf.com","10.75.203.74:30079"))
req.body.add("$.ascReqData.evSubsc.notifUri",req.body.get("$.ascReqData.evSubsc.notifUri").toString().replace("iwf.com","10.75.203.74:30079"))
end
rule "pt_asr_to_pcf_rule"
salience 1
when
req : Request(getUri().toString() matches ".*(npcf-policyauthorization)*(v1)*(notification)*(terminate).*")
then
req.getHttpMessageFactImpl().forwardPath=IWFConsts.FORWARD_TO_H2D
req.headers.add("diameterApplicationId","16777236")
req.headers.add("diameterCommandCode","274")
req.headers.add("original-req-uri",req.getUri())
end
rule "pt_ccri_to_h2d_rule"
salience 1
when
req : Request(req.getUri() matches ".*(npcf-smpolicycontrol/v1/sm-policies)(/$|$)")
then
req.getHttpMessageFactImpl().forwardPath=IWFConsts.FORWARD_TO_H2D
req.headers.put("diameterApplicationId","16777238")
req.headers.put("diameterCommandCode","272")
req.headers.put("requestType","CREATE")
end
rule "pt_ccru_to_h2d_rule"
salience 1
when
req : Request(req.getUri() == ".*(npcf-smpolicycontrol/v1/sm-policies/)(.*)(/update)(/$|$)")
then
req.getHttpMessageFactImpl().forwardPath=IWFConsts.FORWARD_TO_H2D
req.headers.put("diameterApplicationId","16777238")
req.headers.put("diameterCommandCode","272")
req.headers.put("requestType","UPDATE")
req.headers.put("original-req-uri",req.getUri())
end
rule "pt_ccrt_to_h2d_rule"
salience 1
when
req : Request(req.getUri() matches ".*(npcf-smpolicycontrol/v1/sm-policies/)(.*)(/delete)(/$|$)")
then
req.getHttpMessageFactImpl().forwardPath=IWFConsts.FORWARD_TO_H2D
req.headers.put("diameterApplicationId","16777238")
req.headers.put("diameterCommandCode","272")
req.headers.put("requestType","DELETE")
req.headers.put("original-req-uri",req.getUri())
end
NF-Mediation Rule Configuration
Add below rules to the mediation rules:
function Map<Object, Object> addObject() {
return new HashMap<Object, Object>();
}
function ArrayList<Object> addArray() {
return new ArrayList<Object>();
}
function Map<String,Object> ipEndPoints(String ipv4Address, String ipv6Address, String ipv6Prefix){
Map< String,Object> ipEndPointObj = new HashMap< String,Object>();
ipEndPointObj.put("ipv4Address", ipv4Address);
ipEndPointObj.put("ipv6Address", ipv6Address);
ipEndPointObj.put("ipv6Prefix",ipv6Prefix );
return ipEndPointObj;
}
rule "New Rule1"
agenda-group "scp"
when
req : Request(body.get("$.apiPrefix")=="/mediation")
then
req.headers.put("x-dest-path",req.body.get("$.apiPrefix").toString())
end
rule "New Rule2"
when
req : Request(body.has("$.defaultNotificationSubscriptions[*].callbackUri","pcf.oracle.com/pcs/v1.0/nrf/notifycallback"))
then
req.body.add("$.ipEndPoints",ipEndPoints("10.75.243.193","2001:0db8:85a3:0000:0000:8a2e:0370:7335","2001:0db8:85a3"))
end
rule "New Rule3"
when
req : Request(headers.has("x-forwarded-NF","PCF") && body.has("$.fqdn","pcf.oracle.com"))
then
req.headers.put("x-forwarded-NF","AMF")
req.body.put("$","fqdn","amf.oracle.com")
end
rule "New Rule4"
when
req : Request(body.get("$.serviceName")=="svc1")
then
req.headers.del("x-service-name")
end
rule "New Rule5"
when
req : Request(headers.get("x-number") in (1,2,3,4,5 ))
then
req.headers.put( "x-original-authority", "10.172.19.110:8080")
end