Request Construction
Diameter Request Construction
When constructing Diameter messages to send, the DSG-SCP is able to modify the values of core AVPs and include additional AVPs as required.
Request configuration has several sub-sections:
- The
service_identifiers
,rating_groups
,requested_times
, andservice_context_ids
blocks for specifying Selector Rules to set for the values to use in the core Diameter rating AVPsService-Identifier
,Rating-Group
,Requested-Service-Unit
→CC-Time
, andService-Context-Id
, respectively. - The
additional_mscc_avps
andadditional_root_avps
blocks, which allow the inclusion of arbitrary AVPs within the DiameterMultiple-Services-Credit-Control
AVP and the message root, respectively.
A sample Diameter request configuration might be:
<application name="<application instance name>" module="DsgScpApp">
...
<config>
<diameter>
...
<request>
<service_identifiers>
<rule literal="1" tag="network" value="home" />
<rule literal="2" tag="network" value="national_roaming" />
<rule literal="3" />
</service_identifiers>
<rating_groups>
<rule literal="10" tag="bearer" value="voice" />
</rating_groups>
<requested_times />
<service_context_ids>
<rule literal="n2dsg_test@nsquared.nz"/>
</service_context_ids>
<additional_mscc_avps />
<additional_root_avps>
<avp code="873" vendor_id="10415"> <!-- Service-Information -->
<avp code="876" vendor_id="10415"> <!-- IMS-Information -->
<avp code="831" vendor_id="10415" idp="callingPartyNumber_digits_n" /> <!-- Calling-Party-Address -->
<avp code="832" vendor_id="10415" idp="calledPartyNumber_digits_n" /> <!-- Called-Party-Address -->
</avp>
<avp code="3410" vendor_id="10415"> <!-- VCS-Information -->
<avp code="3412" vendor_id="10415" idp="bearerCap_itc" /> <!-- Bearer-Capability -->
<avp code="3417" vendor_id="10415" from_tag="msc" /> <!-- MSC-Address -->
<avp code="3420" vendor_id="10415" from_tag="vlr" /> <!-- VLR-Number -->
<avp code="3414" vendor_id="10415" from_tag="location" /> <!-- ISUP-Location-Number -->
</avp>
</avp>
</additional_root_avps>
</request>
...
</diameter>
...
</config>
...
This configuration would construct Diameter requests with the following characteristics:
- The
service_identifiers
block specifies that the DiameterService-Identifier
will be set to1
when thenetwork
tag has the valuehome
,2
when that tag has the valuenational_roaming
, and3
otherwise. - The
rating_group
block specifies that the DiameterRating-Group
will be set to10
when thebearer
tag has the valuevoice
, and will otherwise not be set at all. - As there are no rules in the
requested_times
block, the DiameterRequested-Service-Unit
→CC-Time
AVP’s value will be set from the default configuration parameters. - The Diameter
Service-Context-Id
AVP will always be set to a single value, as configured in theservice_context_ids
block. - As the
additional_mscc_avps
section is empty, no additional AVPs will be sent in the DiameterMultiple-Services-Credit-Control
AVP. - The
additional_root_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 tag values.
Configuration Details
The config
→ diameter
→ request
configuration block holds configuration for the specific handling that is applied
to build and send Diameter messages to the OCS. The available element attributes and children are:
Attribute | Type | Description |
---|---|---|
service_identifiers
|
Array |
Holds the rules that are applied to determine the value of the Diameter Service-Identifier AVP.
If not present, or if no rules are specified, no Diameter Service-Identifier will be sent to the OCS.
|
.rule
|
Object |
Provisions a Selector Rule for setting
the value of the Diameter Service-Identifier AVP.
|
rating_groups
|
Array |
Holds the rules that are applied to determine the value of the Diameter Rating-Group AVP.
If not present, or if no rules are specified, no Diameter Rating-Group will be sent to the OCS.
|
.rule
|
Object |
Provisions a Selector Rule for setting
the value of the Diameter Rating-Group AVP.
|
requested_times
|
Array |
Holds the rules that are applied to determine the value of the Diameter Requested-Service-Unit →
CC-Time AVP.
If not present, or no rules are specified, the diameter_default_rsu_seconds
application parameter value will be sent to the OCS in Diameter
Requested-Service-Unit → CC-Time AVPs.
|
.rule
|
Object |
[Required] Provisions a Selector Rule for setting
the value of the Diameter Requested-Service-Unit → CC-Time AVP.
|
service_context_ids
|
Array |
Holds the rules that are applied to determine the value of the Diameter Service-Context-Id AVP.
|
.rule
|
Object |
[Required] Provisions a Selector Rule for setting
the value of the Diameter Service-Context-Id AVP.
If not present, or no rules are specified, the diameter_default_service_context_id
application parameter value will be sent to the OCS in Diameter
Service-Context-Id AVPs.
|
additional_mscc_avps
|
Array |
Holds the additional AVP definitions that are added at the end of the
Diameter Multiple-Services-Credit-Control AVP.
|
.avp
|
Object |
[Required] Provisions a single additional AVP definition for
freeform AVP inclusion in the Diameter Multiple-Services-Credit-Control AVP.
|
additional_root_avps
|
Array | Holds the additional AVP definitions that are added at the end of the Diameter request. |
.avp
|
Object | [Required] Provisions a single additional AVP definition for freeform AVP inclusion in the Diameter request. |
Additional AVP Definitions
Within the additional_mscc_avps
and additional_root_avps
blocks, an AVP tree can be specified for inclusion within
Diameter request messages that are constructed.
Each avp
definition may be either a leaf AVP, containing a source value, or may contain 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), 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 reject the message that is being constructed.
Additional AVPs at the MSCC level are not sent if there is no Diameter Multiple-Services-Credit-Control AVP sent, e.g. if MSCC is not enabled via configuration or the message is terminating a root session without MSCC.
Note that all AVPs listed for inclusion must be pre-configured in the N2SVCD Diameter codec. Refer to the N2SVCD technical guide for details.
The available element attributes and children for each avp
definition are:
Attribute | Type | Description |
---|---|---|
code
|
String |
[Required] The AVP code for this AVP definition. The combination of the code and
vendor_id must be configured in the N2SVCD Diameter codec.
|
vendor_id
|
String |
The Diameter Vendor-Id for this AVP definition, if required. The combination of the code
and vendor_id must be configured in the N2SVCD Diameter codec.(Default = 0 , IANA AVP code values).
|
literal
|
String |
[Conditional] A literal value to use as the source value for this AVP. One of literal ,
idp , or from_tag must be present for each AVP definition that is not a grouped AVP.
|
idp
|
String |
[Conditional] An available field
from the InitialDP to use as the source value for this AVP. Multiple fields may be separated by
a comma, and will be concatenated (if populated). One of literal ,
idp , or from_tag must be present for each AVP definition that is not a grouped AVP.
|
from_tag
|
String |
[Conditional] A tag to use as the source value for this
AVP. Multiple tags may be separated by a comma, and will be concatenated (if populated). One of
literal , idp , or from_tag must be present for each AVP definition
that is not a grouped AVP.
|
r_index
|
Integer |
For idp and from_tag source selection, r_index can be used to specify
the starting index for value retrieval. Positive values count from the start of the string (zero-indexed), and
negative values count from the end. Used in conjunction with r_len to provide any substring of the
selected value, including prefix or suffix.(Default: 0 , copy from the start of the string)
|
r_len
|
Positive Integer |
For idp and from_tag source selection, r_len can be used to specify the
returned length of the selected value. Used in conjunction with r_index to provide any substring of
the selected value, including prefix or suffix.(Default: the selected value's remaining length after r_index has been applied)
|
mandatory
|
Boolean |
Whether this AVP must be included in outbound messages or not. If false , if the AVP cannot be
populated with a source value or with AVP children, the AVP will not be included in the sent Diameter request.
If true and the AVP cannot be populated from, the Diameter request will not be sent.Note that this does not apply to AVPs that are deliberately not populated due to configured filter conditions, e.g. at_initial .(Default = false , allow request without this AVP).
|
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 any of the following apply:
|
tag
|
String |
[Conditional] A tag name to require a specific value
for to trigger population of the AVP. If tag is present, value > must also be present.
|
tag_x
|
String |
[Conditional] As for tag , but with x representing a unique pairing, e.g.
tag_1 or tag_a . A matching value_x must also be present.
|
value
|
String |
[Conditional] The string or integer value to match against during AVP population.
Required when tag is present.
|
value_x
|
String |
[Conditional] As for value , but with x representing a unique pairing, e.g.
value_1 or value_a . A matching tag_x must also be present.
|
originating
|
Boolean |
Whether this AVP should be included for requests for
originating calls (Default: true )
|
forwarding
|
Boolean |
Whether this AVP should be included for requests for
forwarding calls. (Default: true )
|
terminating
|
Boolean |
Whether this AVP should be included for requests for
terminating calls. (Default: true )
|
at_initial
|
Boolean |
Whether this AVP should be included at the initial OCS interrogation, i.e. the Diameter CC-Request-Type is
1 (INITIAL_REQUEST ).(Default: true )
|
at_update
|
Boolean |
Whether this AVP should be included at interim OCS interrogations, i.e. the Diameter CC-Request-Type is
2 (UPDATE_REQUEST ).(Default: true )
|
at_terminate
|
Boolean |
Whether this AVP should be included at the final OCS interrogation, i.e. the Diameter CC-Request-Type is
3 (TERMINATE_REQUEST ).(Default: true )
|
(other available fields) | (various) | Any number of selector rule available fields. |