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 AVPs.
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)

AVP Parameters

In addition to the parameters in Diameter outbound request operations, each AVP definition may contain the following elements:

Argument Type Notes
bytes String Optional raw bytes representing the entire AVP including headers and padding.
If present, it is used without further checking and all other attributes are ignored.

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 fields as for a request.

Note that the decoded avps array will contain all fields for each AVP, 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 encoded bytes of the AVP value without any interpretation.