Events stored in the streaming database of the master domain

Location path

Path in the assembly catalog Description

/era_env/priv/metadata/master/events/events.json

Descriptor of the composition of classes and event types (events.json)

/era_env/priv/metadata/master/events/<EVENT_CLASS>/<EVENT_TYPE>.json

Descriptor of event fields of type

Overview

A set of assets that filter events and the composition of their fields between generation in the system and saving to the streaming database of the master domain (CDR common).

Based on metadata files:

  • the structure of the event stream domain database is automatically formed, schemes, tables, columns of the specified types are created;

  • filtering of generated events stored in the streaming database up to complete absence;

  • the composition of fields of generated events is filtered to save a limited number of them in the database.

A list and description of event classes, event types and their fields are available in section.

Descriptor of the composition of classes and event types (events.json)

List of event classes and event types contained in them to be saved to the event stream database of the master domain (CDR common).

Each of the listed event classes must have a separate directory in the events folder, within which for each type of event of this class there must be a file describing the composition of the event fields to be saved in the database.

Format:
[
  {
    "class": str,
    "events": array<str>
  },
  ...
]
  • class – event class name.

  • events – list of event type names included in the class.

Example events.json

Lists all master-domain event classes and their included event types

Example:
[
  {
    "class": "callevents",
    "events": [
      "call_asr",
      "call_rec_links",
      "dlg_binding",
      "dlg_call",
      "dlg_dead",
      "dlg_init",
      "dlg_pickup",
      "dlg_start",
      "dlg_stop",
      "fork_answer",
      "fork_cancel",
      "fork_preanswer",
      "fork_redirect",
      "fork_start",
      "fork_stop",
      "hold",
      "invite",
      "media_migrate_done",
      "rec_info",
      "records_moved",
      "refer",
      "replaces_invite",
      "replaces_refer",
      "route",
      "route_feature",
      "route_fin",
      "route_redirect",
      "route_referred",
      "route_replacing",
      "route_dead",
      "unhold",
      "user_redirect"
    ],
    "partition": {
      "cdr": {
        "fields": [
          "invitedt"
        ],
        "template": "datemonth"
      }
    }
  },
  {
    "class": "confevents",
    "events": [
      "call_attach",
      "call_detach",
      "conf_dead",
      "conf_init",
      "conf_rec_links",
      "conf_start",
      "conf_stop",
      "fork_answer",
      "fork_preanswer",
      "fork_start",
      "fork_stop"
    ]
  }
]

Descriptor of event fields of type

The catalog of the event class. It is named by the name of the class. It contains inside descriptor files for all event types of the class, their fields and value types in the database. The file names correspond to the names of event types.

Format:
{
  "class": str,
  "type": str,
  "fields": [
    {
      "name": str,
      "type": "varchar" | "bigserial" | "timestamp" | "uuid" | "integer",
      "required": true | false
    },
    ...
  ]
}
  • class – event class name (duplicate of the catalog name).

  • type – event type name (duplicate file name).

  • fields – list of fields to be saved in the database (the table structure):

    • name – event field name and at the same time column name in the database table.

    • type – column value type in the database table.

    • required – field mandatory characteristic (by default false).

    • default – default value (for fields with required = false)

Example

Sample file for event type callevents.dlg_start, location /callevents/dlg_start.json.

Example
{
  "class": "callevents",
  "type": "dlg_start",
  "fields": [
    { "name": "id", "type": "bigserial" },
    { "name": "acallid", "type": "varchar", "required":true },
    { "name": "dialogid", "type": "varchar" },
    { "name": "alocaluri", "type": "varchar" },
    { "name": "alocaltag", "type": "varchar" },
    { "name": "aremoteuri", "type": "varchar" },
    { "name": "bcallid", "type": "varchar" },
    { "name": "blocaluri", "type": "varchar" },
    { "name": "blocaltag", "type": "varchar" },
    { "name": "bremoteuri", "type": "varchar" },
    { "name": "usemedia", "type": "bool" },
    { "name": "mgc", "type": "varchar" },
    { "name": "msid", "type": "varchar" },
    { "name": "reclinks", "type": "varchar" },
    { "name": "isrec", "type": "boolean" },
    { "name": "invitets", "type": "bigint" },
    { "name": "eventts", "type": "timestamp" },
    { "name": "acallidhash", "type": "bigint" },
    { "name": "dialogidhash", "type": "bigint" },
    { "name": "cid", "type": "uuid" },
    { "name": "invitedt", "type": "timestamp"},
    { "name": "aremoteparty", "type": "varchar" },
    { "name": "aremotecontact", "type": "varchar" },
    { "name": "bremotecontact", "type": "varchar" },
    { "name": "ausername", "type": "varchar" },
    { "name": "adomain", "type": "varchar" },
    { "name": "adisplayname", "type": "varchar" },
    { "name": "anetworkaddr", "type": "varchar" },
    { "name": "acallednum", "type": "varchar" },
    { "name": "arepresentative", "type": "varchar" },
    { "name": "aouter", "type": "boolean" },
    { "name": "aprovidercode", "type": "varchar" },
    { "name": "busername", "type": "varchar" },
    { "name": "bdomain", "type": "varchar" },
    { "name": "bdisplayname", "type": "varchar" },
    { "name": "bnetworkaddr", "type": "varchar" },
    { "name": "bouter", "type": "boolean" },
    { "name": "bprovidercode", "type": "varchar" },
    { "name": "anumber", "type": "varchar" },
    { "name": "bnumber", "type": "varchar" },
    { "name": "ctxscridm", "type": "varchar" },
    { "name": "ctxscridd", "type": "varchar" },
    { "name": "relates", "type": "varchar" }
  ]
}