sipcapture / homer

HOMER - 100% Open-Source SIP, VoIP, RTC Packet Capture & Monitoring
https://sipcapture.org
GNU Affero General Public License v3.0
1.64k stars 242 forks source link

homer 7, 7.10.13 - Understanding question - how to add additional headers and correlation id headers #507

Closed khorsmann closed 2 years ago

khorsmann commented 2 years ago

Hi Folks,

i play around with docker version of homer-7 (7.10.13).

IMHO the collection of data and the views for and Homer admin is as follow:

HEP-Clients --HEPv3--> [ heplify-server --psql--> db (save) <--psql--> homer-webapp ] <--http--> Homer Admin View

So if i need additional stuff like extra headers i configure docker-compose.yml (see below).

Maybe i missconfigure something (i am 100% sure thats the case). I didnt dig to deep into the db if the data is "there" as extra columns or whatever (thats blackbox for me). Have you any hints for me to get this extra Headers working / showing in Homer-7 and how to check X-CID settels correctly into docker (heplify-server)?

Mapping --> call/SIP --> Mapping Settings --> Fields:

...
    {
        "form_type": "input",
        "hide": true,
        "id": "custom_1",
        "index": "none",
        "name": "X-T-Call-Id",
        "position": 24,
        "skip": false,
        "type": "string"
    },
    {
        "form_type": "input",
        "hide": true,
        "id": "custom_2",
        "index": "none",
        "name": "X-Routing-Group",
        "position": 25,
        "skip": false,
        "type": "string"
    },
    {
        "form_type": "input",
        "hide": true,
        "id": "custom_3",
        "index": "none",
        "name": "X-T-Call-Id-In",
        "position": 26,
        "skip": false,
        "type": "string"
    },
    {
        "form_type": "input",
        "hide": true,
        "id": "custom_4",
        "index": "none",
        "name": "X-Billing-Info",
        "position": 27,
        "skip": false,
        "type": "string"
    }
$ git branch
* homer7
$ git log | head -n1
commit d89827595401fad9a670cb1dc84dc801634e8566

$ git clone https://github.com/sipcapture/homer.git
$ cd homer
$ update_subs.sh
$ cd homer-docker/heplify-server/hom7-prom-all
# changed the docker-compose.yml to my needs.
$ docker-compose up -d
--- a/heplify-server/hom7-prom-all/docker-compose.yml
+++ b/heplify-server/hom7-prom-all/docker-compose.yml
...

+      - "HEPLIFYSERVER_ALEGIDS=X-CID"
+      - "HEPLIFYSERVER_CUSTOMHEADER=X-T-Call-Id,X-T-Call-Id-In,X-Routing-Group,X-Billing-Info"
     restart: unless-stopped
     depends_on:
       - loki
@@ -148,7 +150,7 @@ services:
       - "DB_PASS=homerSeven"
     restart: unless-stopped
     ports:
-      - "9080:80"
+      - "80:80"
khorsmann commented 2 years ago

The mapping was wrong. If i check the examples in that file with the mappings and bring the correct key-value pairs in, it works.

lmangani commented 2 years ago

@khorsmann was it wrong in the defaults? should we correct anything?

khorsmann commented 2 years ago

Hi @lmangani

everything is fine. I just was to long in the HEPIC world to see the fine difference in name schemata of homer7. So the id: field needs "dataheader." not "customer" (hepic).

So that is the right json snippet in my case:

...
    {
        "id": "data_header.X-T-Call-Id",
        "name": "X-T-Call-Id",
        "type": "string",
        "index": "none",
        "form_type": "input",
        "position": 24,
        "skip": false,
        "hide": false
    },
    {
        "id": "data_header.X-Routing-Group",
        "name": "X-Routing-Group",
        "type": "string",
        "index": "none",
        "form_type": "input",
        "position": 25,
        "skip": false,
        "hide": false
    },
    {
        "id": "data_header.X-T-Call-Id-In",
        "name": "X-T-Call-Id-In",
        "type": "string",
        "index": "none",
        "form_type": "input",
        "position": 26,
        "skip": false,
        "hide": false
    },
    {
        "id": "data_header.X-Billing-Info",
        "name": "X-Billing-Info",
        "type": "string",
        "index": "none",
        "form_type": "input",
        "position": 27,
        "skip": false,
        "hide": false
    }