DIAMETER-C Messages

Introduction

Any application may use DIAMETER-C-… messages to the DiameterApp to request that an outbound Diameter request be made to an external Diameter server via the DiameterApp.

The following applications from the core n2svcd module make requests to DiameterApp.

The following LuaApp agents from the core n2svcd module use DiameterApp.

The internal DIAMETER-C-… messages are:

Note that this page uses the term “on-the-wire” to refer to the sending or receiving of Diameter content by the DiameterApp. This term is also inclusive of the case where the message is sent by local loopback and does not physically transit a Network Interface Controller (NIC).

DIAMETER-C-REQUEST

The DIAMETER-C-REQUEST message is sent to DiameterApp by any application that wishes to perform an outbound Diameter request.

Refer to the DiameterApp Configuration documentation for more information on setting default parameters.

The attributes of the DIAMETER-C-REQUEST message are:

Field Type Description
diameter Object [Required] Container for the parameters of the Diameter request that we are to send.
.name String The name of the Diameter command, e.g. Credit-Control.
This must be a supported message name within N2::DIAMETER::Codec.
If your command name is not supported, you may instead specify .code.
.code Integer Alternatively you may specify the numeric command value instead of .name.
.application_id Integer Expressly specify the default Application ID in the Diameter message header.
If you set this, you are also responsible for adding Auth-Application-Id AVP.
(Default = Configured Application ID in header and in Auth-Application-Id AVP)
.avps Array of Object Array of AVP descriptors each with the following fields.
[].bytes String Optional raw bytes representing the entire AVP including headers and padding.
If you supply this, then it is used without further checking, and all other attributes are ignored.
[].name String The name of the Diameter AVP, e.g. Rating-Group.
This must be a supported AVP name within N2::DIAMETER::Codec or DiameterApp custom AVPs.
If your AVP name is not supported, you may instead specify [].code.
[].code Integer The code of the Diameter AVP, if not specifying by [].name.
[].vendor_id Integer The vendor ID. This field is optional and can be specified both when selecting the AVP by [].name (to distinguish between scenarios where the same name is used by different vendors) or when selecting the AVP by [].code in order to specify the intended vendor ID.
[].type String One of None, OctetString, UTF8String, DiamIdent, Integer32, Integer64, Unsigned32, Enumerated, Time, Unsigned64, Address, Grouped.
This is used only when specifying an AVP by [].code.
For named AVPs the type is pre-defined.
[].mandatory 0/1 Override the default mandatory AVP flag.
This is used only when specifying an AVP by [].code.
For named AVPs the mandatory flag is pre-defined.
[].encryption 0/1 Override the default encryption AVP flag.
This is used only when specifying an AVP by [].code.
For named AVPs the encryption flag is pre-defined.
[].value Various The value for this AVP.
For AVPs of type Grouped this will be an ARRAY.
For all other AVPs this is a SCALAR of the appropriate type.
.ack_sent 0/1 Flag to indicate if a `DIAMETER-C-SENT` message is sent to the requesting application once the original `DIAMETER-C-REQUEST` is placed on-the-wire. (Default = 0)

DIAMETER-C-SENT

The DIAMETER-C-SENT message is sent by DiameterApp to the requesting application when the original DIAMETER-C-REQUEST is placed on-the-wire.

The attributes of the DIAMETER-C-SENT message are:

Field Type Description
bytes Object [Required] The raw on-the-wire Diameter request bytes.
diameter Object [Required] The attributes of the Diameter message as encoded.
Note however that this object will also contain any field values which were filled-in using default values configured within DiameterApp itself.

DIAMETER-C-RESPONSE

The DIAMETER-C-RESPONSE message is sent by DiameterApp to the requesting application when a Diameter Response is received to the original DIAMETER-C-REQUEST, or if a failure occurs which indicates that no Diameter Response will be received.

The attributes of the DIAMETER-C-RESPONSE message are:

Field Type Description
success 0/1 [Required] Indicates if the request was successful or not.
error String Indicates the reason why the request failed.
Present and applicable only if success == 0.
bytes Object The raw on-the-wire Diameter response bytes.
Present only if success == 1.
diameter Object [Required] Container for the Diameter response parameters received.
Present only if success == 1.
.name String The name of the Diameter command, e.g. Credit-Control.
This is present only when the name is known within N2::DIAMETER::Codec.
.code Integer [Required] The Diameter command code.
.application_id Integer The returned Application-ID from the response header.
.avps Array of Object Array of AVP descriptors each with the fields described as for a request.

Note that the decoded .avps array will contain all fields, i.e. the [].name and [].code and [].type and [].mandatory, etc. will all be present.

The only exception will be when decoding AVPs which are not part of the core fields defined within N2::DIAMETER::Codec and are not defined as custom AVPs in the configuration for DiameterApp. In these cases, the [].name and [].type AVP attributes will not be present, and the [].value will be the raw undecoded bytes of the AVP value without any interpretation.