Diameter Requests
Diameter Requests
When constructing Diameter messages to send, the N2IWF is able to modify the values of core AVPs and include additional AVPs as required.
Request configuration has several sub-sections specified within LogicApp global variables.
- The
SERVICE_IDENTIFIERS
,RATING_GROUPS
,REQUESTED_TIMES
,REQUESTED_UNITS
, andSERVICE_CONTEXT_IDS
globals for specifying selector rules to set the values to use in the core Diameter rating AVPsService-Identifier
,Rating-Group
,Requested-Service-Unit
→CC-Time
,Requested-Service-Unit
→CC-Service-Specific-Units
, andService-Context-Id
, respectively. - The
ADDITIONAL_AVPS
globals, which allows the inclusion of arbitrary AVPs within the Diameter message root.
A sample Diameter request configuration for CAMEL/INAP calls might be:
<global name="SERVICE_IDENTIFIERS" type="array">
<rule literal="1" var="network" value="home" />
<rule literal="2" var="network" value="national_roaming" />
<rule literal="3" />
</global>
<global name="RATING_GROUPS" type="array">
<rule literal="10" var="bearer" value="voice" />
</global>
<global name="REQUESTED_TIMES" type="array">
<rule literal="" initialdp_arg.callingPartyNumber_digits="021477577" />
<rule literal="600" var="network" value="home" />
<rule literal="300" var="network" value="national_roaming" />
<rule literal="65"/>
</global>
<global name="SERVICE_CONTEXT_IDS" literal="n2iwf_test@nsquared.nz"/>
<global name="ADDITIONAL_AVPS" type="array">
<avp name="Multiple-Services-Credit-Control">
<value type="array">
<avp name="IMS-Charging-Identifier" literal="n2" edr="charge_id" />
<avp name="Extension-2" literal="2" />
</value>
</avp>
<avp name="Service-Information">
<value type="array">
<avp name="IMS-Information">
<value type="array">
<avp name="Calling-Party-Address" source="normalised_calling_party" />
<avp name="Called-Party-Address">
<value type="array">
<rule source="normalised_calling_party" />
</value>
</avp>
</value>
</avp>
<avp name="VCS-Information">
<value type="array">
<avp name="MSC-Address" from_var="msc" />
<avp name="VLR-Number" from_var="vlr" />
<avp name="ISUP-Location-Number" from_var="location" />
<avp name="Bearer-Capability" source="bearerCap_itc" />
</value>
</avp>
</value>
</avp>
</global>
This configuration would construct Diameter requests with the following characteristics:
- The
SERVICE_IDENTIFIERS
global specifies that the DiameterService-Identifier
will be set to1
when thenetwork
variable has the valuehome
,2
when that variable has the valuenational_roaming
, and3
otherwise. - The
RATING_GROUPS
global specifies that the DiameterRating-Group
will be set to10
when thebearer
variable has the valuevoice
, and will otherwise not be set at all. - As there are no rules in the
REQUESTED_TIMES
global, the DiameterRequested-Service-Unit
→CC-Time
AVP’s value will be set from the fallback requested units rules. - The Diameter
Service-Context-Id
AVP will always be set to a single value, as configured in theSERVICE_CONTEXT_IDS
global. The fallback service context ID will not be used. - The
ADDITIONAL_AVPS
section shows the AVP tree that will be inserted at the root of the Diameter message, including the 3GPP AVPService-Information
with its contents extracted from theInitialDP
and from variable values.
Rating Groups
The LogicApp
global variable RATING_GROUPS
holds the selector rules that
are applied to determine the value of the Diameter Rating-Group
AVP.
If not present, or if no rules are specified or matched, no Rating-Group
will be sent to the OCS in requests.
Service Identifiers
The LogicApp
global variable RATING_GROUPS
holds the selector rules that
are applied to determine the value of the Diameter Service-Identifier
AVP.
If not present, or if no rules are specified or matched, no Service-Identifier
will be sent to the OCS in requests.
Requested Times
The LogicApp
global variable REQUESTED_TIMES
holds the selector rules that
are applied to determine the value of the Diameter Requested-Service-Unit
→ CC-Time
AVP when using the
SCUR charging model.
An empty string may be specified as a literal if no CC-Time
AVP is to be sent, i.e. the Requested-Service-Unit
AVP is
empty. Note that this is in contradiction to the Diameter Credit-Control standards, but some OCSs require this configuration.
The following rule is appended to this ruleset to act as a fallback:
<rule literal="60" />
Requested Units
The LogicApp
global variable REQUESTED_UNITS
holds the selector rules that
are applied to determine the value of the Diameter Requested-Service-Unit
→ CC-Service-Specific-Units
AVP when using
the ECUR or IEC charging models.
An empty string may be specified as a literal if no CC-Service-Specific-Units
AVP is to be sent, i.e. the
Requested-Service-Unit
AVP is empty. Note that this is in contradiction to the Diameter Credit-Control standards, but
some OCSs require this configuration.
The following rule is appended to this ruleset to act as a fallback:
<rule literal="1" />
Service Context IDs
The LogicApp
global variable SERVICE_CONTEXT_IDS
holds the selector rules that
are applied to determine the value of the Diameter Service-Context-Id
AVP.
If no rule applies, the value n2iwf@nsquared.nz
is used.
Additional AVPs
The LogicApp
global variable ADDITIONAL_AVPS
holds additional AVP definitions that are added at the end of the Diameter request.
This global is an array of AVPs, with each avp
definition containing either a source value or other avp
definitions.
AVPs are added in the order listed.
If a source value for an AVP does not have a value (e.g. the network did not provide it for population), the AVP will not
be sent. Grouped AVPs with other AVPs as their children must have at least one child present to be sent. An AVP may be marked
as mandatory
, in which case a failure to populate it will cause the session to be handled using
error-handling rules.
Note that all AVPs listed for inclusion must exist in the N2SVCD Diameter codec or be specified in the Diameter application as custom AVPs.
In addition to the standard IWF selector rule extensions, each
avp
definition supports additional parameters:
Parameter | Type | Description |
---|---|---|
name |
String | [Required] The AVP name for this definition. This name must be present in the default N2SVCD Diameter codec or configured as a custom AVP in the Diameter application. |
edr |
String | If provided, the AVP’s populated value will be written to EDRs produced in the field named. Note that the EDR field will not be filled if the AVP was not sent to the OCS for any reason. Does not apply to Grouped AVPs, i.e. AVPs with children. |
mandatory |
Boolean | Whether this AVP must be included in outbound messages or not. If set to false and the AVP cannot be populated with a source value or with child AVP, the AVP will not be included in the sent Diameter request. If true and the AVP cannot be populated, the session will be handled using error-handling rules.(Default = false , allow request without this AVP). |
value |
Array | Holds the value of an AVP. If the AVP is not Grouped and is not defined as a shorthand ruleset, may be used to specify an array of selector rules for populating the AVP. For Grouped AVPs, contains the child AVPs to populate. Note that in all cases that this must specifically be marked as type="array" in order to be correctly processed as a complex global. |
Diameter Session-Id Generation
Diameter Session-Id
AVPs sent to the OCS in initial requests are generated in the following format:
<prefix>;<hostname>-<application>-<instance ID>;<epoch>:<microseconds>
Where:
<prefix>
is the value of theDIAMETER_SID_PREFIX
Diameter parameter.<hostname>
,<application>
, and<instance ID>
are the Lua service globalsHOSTNAME
,APPLICATION_NAME
, andINSTANCE_IDX
, respectively.<epoch>
is the current epoch value.<microseconds>
is the number of microseconds since application startup.