sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
200 stars 77 forks source link

Homer-App duplicate LOG messages in Ladder Diagram #540

Closed alex-replicant closed 7 months ago

alex-replicant commented 8 months ago

We are looking to capture Freeswitch ESL (sipcapture/hepipe.js) events in Homer7 Got the basics working, heppipe gets JSON events and sends them to Heplify, Heplify stores received JSON payload to 'raw' field (var_char)

Running the latest version of heplify and homer-app (Docker Hub images )

./homer-app --version
VERSION: 1.4.53

./heplify-server --version
Could not find toml config file, use flag defaults. <nil>
VERSION: heplify-server 1.59.5

The issue appears to be in Ladder Diagram via on the Homer-App. It displays each independant ESL event twice as LOG and HEP-LOG entry

e.g. if hep_proto_100_default contains 20 events for a given sid, export feature in text - will export 20 events, however ladder diagram will show 40 (20-HEP-LOG and 20-LOG)..

homer-app logs show the following queries when ladder diagram is loaded:

homer-webapp   | time="2023-11-22T16:56:38Z" level=info msg="SELECT * FROM \"user_settings\"  WHERE (category = 'dashboard' AND (username = $1 and param = $2))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:38Z" level=info msg="SELECT count(*) FROM \"user_settings\"  WHERE (category = 'dashboard' AND (username = $1 and param = $2))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:38Z" level=info msg="SELECT * FROM \"alias\"  WHERE (status = true)" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:38Z" level=info msg="SELECT * FROM \"user_settings\"  WHERE (category = 'dashboard' AND (username = $1 OR (data ->> 'shared' = 'true' OR data ->> 'shared' = '1')))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:38Z" level=info msg="SELECT * FROM \"user_settings\"  WHERE (category = 'dashboard' AND (username = $1 and param = $2))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:38Z" level=info msg="SELECT * FROM \"mapping_schema\"  WHERE (partid = $1)" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:38Z" level=info msg="SELECT count(*) FROM \"user_settings\"  WHERE (category = 'dashboard' AND (username = $1 and param = $2))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:38Z" level=info msg="SELECT * FROM \"user_settings\"  WHERE (category = 'dashboard' AND (username = $1 OR (data ->> 'shared' = 'true' OR data ->> 'shared' = '1')))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:39Z" level=info msg="SELECT * FROM \"hep_proto_1_call\"  WHERE (create_date between $1 AND $2) LIMIT 200" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:45Z" level=info msg="SELECT * FROM \"mapping_schema\"  WHERE (hepid = $1 and profile = $2)" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:45Z" level=info msg="SELECT * FROM \"global_settings\"  " module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:45Z" level=info msg="SELECT * FROM \"alias\"  WHERE (status = true)" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:45Z" level=info msg="SELECT * FROM \"hep_proto_1_call\"  WHERE (create_date between $1 AND $2 AND sid in ($3))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:45Z" level=info msg="SELECT * FROM \"hep_proto_100_default\"  WHERE (create_date between $1 AND $2 AND sid in ($3))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:45Z" level=info msg="SELECT * FROM \"hep_proto_5_default\"  WHERE (create_date between $1 AND $2 AND sid in ($3))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:46Z" level=info msg="SELECT * FROM \"hep_proto_1_call\"  WHERE (create_date between $1 AND $2 AND sid in ($3))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:46Z" level=info msg="SELECT * FROM \"hep_proto_1_call\"  WHERE (create_date between $1 AND $2 AND data_header->>'callid' in ($3,$4))" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT * FROM \"hepsub_mapping_schema\"  " module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT count(*) FROM \"hepsub_mapping_schema\"  " module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT * FROM \"agent_location_session\"  " module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT count(*) FROM \"agent_location_session\"  " module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT * FROM \"hepsub_mapping_schema\"  " module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT count(*) FROM \"hepsub_mapping_schema\"  " module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT * FROM \"agent_location_session\"  WHERE (expire_date > NOW() AND guid = 'c4ca6200-8230-41cb-b056-bfed29908b91' AND type LIKE '%cdr%')" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT count(*) FROM \"agent_location_session\"  WHERE (expire_date > NOW() AND guid = 'c4ca6200-8230-41cb-b056-bfed29908b91' AND type LIKE '%cdr%')" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT * FROM \"hep_proto_100_default\"  WHERE (sid in ($1) and create_date between $2 and $3)" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT * FROM \"hep_proto_5_default\"  WHERE (sid in ($1) and create_date between $2 and $3)" module=gorm type=sql
homer-webapp   | time="2023-11-22T16:56:48Z" level=info msg="SELECT * FROM \"hep_proto_35_default\"  WHERE (sid in ($1) and create_date between $2 and $3)" module=gorm type=sql

database throws errors when I click on HEP-LOG entry:

2023-11-22 16:59:28.169 UTC [2061] ERROR:  syntax error at or near "{" at character 98
2023-11-22 16:59:28.169 UTC [2061] STATEMENT:  SELECT * FROM "hep_proto_100_default"  WHERE (create_date between $1 and $2 AND id IN ((HEP-LOG) {"headers":[{"name":"Event-Name","value":"CHANNEL_)) LIMIT 200

however seem to work fine when I click just LOG entry (and LOG entry correctly displays JSON format from raw field)

Questions:

1) Would it be possible to avoid loading HEP-LOG entries in ladder view? 2) Would it be possible to add a Title to LOG entries in ladder view (maybe an EVENT_NAME or something along those lines)

Thank you in advance

github-actions[bot] commented 8 months ago

Your report is appreciated. Please star this repository to motivate its developers! :star:

alex-replicant commented 7 months ago

doing more googling about this... https://groups.google.com/g/homer-discuss/c/GR369pajRyk The solution to question 1 is simple -- uncheck either LOG or HEP-LOG in Payload type section of the filter