Skip to content

Example: HEPIC HSP

Lorenzo Mangani edited this page Jun 14, 2023 · 33 revisions

HEPIC CDR Emitter

The HEPIC platform can export realtime metrics and CDRs using the HSP protocol. The hsp paStash module implements support for decoding its bencode-style float format and fields.

Installation

npm
# sudo npm install -g @pastash/pastash

In case of permission errors, use the following override command:

# sudo npm install -g @pastash/pastash

HEPIC settings (picserver.ini)

[cdr]
enable = true
callonly = true
host = 127.0.0.1
port = 18909
websocket = true

Collector Recipe

Save the following recipe to a file: /opt/pastash/etc/hsp_cdr.conf

input {
  ws{
    host => 127.0.0.1
    port => 18909
    path => "/ws"
  }
}

filter {
}

output {
  stdout {}
}

This example will not actually send anything. Add your preferred delivery method to the output block.

output {
  stdout {}
  kafka{
    topic => "hepic"
    kafkaHost => "some_url_here"
    debug => true
  }
}
 

Run

./bin/pastash --config_file=/path/to/pastash_hsp.conf

Output Sample

[STDOUT] {
    "type": "call",
    "uuid": "3246d56d-92d3-11e7-956d-000019432987",
    "gid": 10,
    "sigproto": 6,
    "source_ip": "x.x.x.x",
    "source_port": 53636,
    "destination_ip": "y.y.y.y",
    "destination_port": 5060,
    "modify_ts": 1504682180895,
    "micro_ts": 1504682143734718,
    "cdr_connect": 1504682143847,
    "cdr_stop": 1504682175899,
    "ruri_user": "5000",
    "ruri_domain": "sip.domain.com",
    "from_user": "250",
    "from_domain": "sip.domain.com",
    "to_user": "5000",
    "to_domain": "sip.domain.com",
    "auth_user": "250",
    "contact_user": "250",
    "dialog_id": "[email protected]",
    "uas": "Grandstream GXP2200 1.0.3.27",
    "anumber_ext": "250",
    "bnumber_ext": "5000",
    "codec_in_audio": 0,
    "codec_in_video": 0,
    "codec_out_audio": 0,
    "codec_out_video": 0,
    "sdpsid": 8000,
    "sdpsver": 8000,
    "srd": 0,
    "sss": 112,
    "sdmedia_ip": "z.z.z.z",
    "sdp_ap": 5004,
    "capt_id": 2001,
    "vst": 1,
    "rf_a": 92.95,
    "mos_a": 4.4,
    "pl_a": 0,
    "jt_a": 0,
    "mos": 440,
    "geo_cc": "NL",
    "geo_lat": 52.2687,
    "geo_lan": 4.6445,
    "dest_cc": "MD",
    "dest_lat": 47.411633,
    "dest_lan": 28.369884,
    "proto": 1,
    "group": "default",
    "duration": 32,
    "status_text": "FINISHED",
    "geopoint": "52.2687,4.6445",
    "destpoint": "47.411633,28.369884",
    "d_description": "Netherlands",
    "d_total_cost": 0.00399450821918432,
    "d_country": "Netherlands",
    "d_prefix": "31",
    "d_price": "0.74897029109706",
    "peer_lookup": {
      "id": "5000",
      "customer": "QXIP",
      "tenant": "QXIP BV (qxip)"
    }
}

Clone this wiki locally