sipcapture / homer-app

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

share link issue #408

Closed kpribic closed 3 years ago

kpribic commented 3 years ago

Summary: Share link generated by homer7 doesn't work if call is correlated across two call IDs.

When generating link (Export->Share link) with WebUI 7.9.10, and the call has two callIDs then both call IDs end up in the URI. However when you try to use that URI Homer doesn't display the call data at all (empty table). There is data fetched from the DB but web gui part throws errors in the console and simply shows nothing (tested in latest chrome and firefox).

main.468813c2bb716545026d.js:1 ERROR TypeError: Cannot read property 'length' of undefined
...

Same URL renders data without any issues if the second call ID is removed. This query doesn't work:

https://5.5.5.5/search/result?%7B%22timestamp%22:%7B%22from%22:1612280465649,%22to%22:1612281017178%7D,%22param%22:%7B%22search%22:%7B%22100_default%22:%7B%22id%22:41438305,%22callid%22:%5B%22af559c07-2df6-42f6-9901-f708ec0970e8%22,%22b0a0717b-d458-4479-b586-f8149acfcf90%22%5D,%22uuid%22:%5B%5D%7D%7D,%22location%22:%7B%22node%22:%5B%22xxx%22%5D%7D,%22transaction%22:%7B%22call%22:false,%22registration%22:false,%22rest%22:true%7D,%22id%22:%7B%7D,%22timezone%22:%7B%22value%22:-60,%22name%22:%22Local%22%7D%7D%7D=

Part with call IDs:

...
        "callid": [
          "af559c07-2df6-42f6-9901-f708ec0970e8",
          "b0a0717b-d458-4479-b586-f8149acfcf90"
        ],
...

This query works:

https://5.5.5.5/search/result?%7B%22timestamp%22:%7B%22from%22:1612280465649,%22to%22:1612281017178%7D,%22param%22:%7B%22search%22:%7B%22100_default%22:%7B%22id%22:41438305,%22callid%22:%5B%22af559c07-2df6-42f6-9901-f708ec0970e8%22%5D%22uuid%22:%5B%5D%7D%7D,%22location%22:%7B%22node%22:%5B%22xxx%22%5D%7D,%22transaction%22:%7B%22call%22:false,%22registration%22:false,%22rest%22:true%7D,%22id%22:%7B%7D,%22timezone%22:%7B%22value%22:-60,%22name%22:%22Local%22%7D%7D%7D=

Part with call IDs:

...
        "callid": [
          "af559c07-2df6-42f6-9901-f708ec0970e8"
        ],
...
AlexeyOplachko commented 3 years ago

Hello, this doesn't seem to be happening on our setup, can you please provide copy of XHR request to /data API endpoint? Preferably in text file/pastebin link To do this(on Chrome) you need to press f12, go to network tab(might need to reload page after opening the tab), find where it says data press with right mouse button and copy response.

And if possible a screenshot of pretty-printed code around this error ERROR TypeError: Cannot read property 'length' of undefined because otherwise it's very unspecific To do this(on Chrome) in console press on main.468813c2bb716545026d.js:1, and press this button image, it might take a bit to load depending on you specs.

Also just to make sure, can you provide you homer-app version?

kpribic commented 3 years ago

Hi @AlexeyOplachko . I'm sorry but I think I misdiagnosed the initial issue, it doesn't appear to be related to callIDs, I must have done something wrong when testing it before. Issue is probably related to using 1_call and 100_default at the same time, and in my architecture that happens always with two SIP callids. In this case there are logs in 100_default that are correlated to 1_call via sid (callid).

This is the process to generate an URL that doesn't work. 1) I deeplink the SIP call via manually generated URL:

https://5.5.5.5/search/result?%7B%22timestamp%22:%7B%22from%22:1613382631000,%22to%22:1613383104000%7D,%22param%22:%7B%22search%22:%7B%221_call%22:%7B%22callid%22:%5B%2246075fb3-474a-463e-8f04-74eecab53c96%22%5D,%22uuid%22:%5B%5D%7D%7D,%22location%22:%7B%22node%22:%5B%22xxx%22%5D%7D,%22transaction%22:%7B%22call%22:true,%22registration%22:false,%22rest%22:false%7D,%22id%22:%7B%7D,%22timezone%22:%7B%22value%22:-60,%22name%22:%22Local%22%7D%7D%7D=

important part is the "1_call":

    "search": {
      "1_call": {
        "callid": [
          "46075fb3-474a-463e-8f04-74eecab53c96"
        ],

2) It displays SIP messages in gui. When I click on it to correlate properly shows the flow, SIP and LOGs. Everything works as expected. 3) I go to Export->Share Link, generate a link, Link is now a bit different because correlated call contains logs from 100_Default and homer decided to start from there:

https://5.5.5.5/search/result?%7B%22timestamp%22:%7B%22from%22:1613382451405,%22to%22:1613383184153%7D,%22param%22:%7B%22search%22:%7B%22100_default%22:%7B%22id%22:43760287,%22callid%22:%5B%2246075fb3-474a-463e-8f04-74eecab53c96%22,%22edd5542d-fd48-4b87-94d3-f66fb192fa69%22%5D,%22uuid%22:%5B%5D%7D%7D,%22location%22:%7B%7D,%22transaction%22:%7B%22call%22:false,%22registration%22:false,%22rest%22:true%7D,%22id%22:%7B%7D,%22timezone%22:%7B%22value%22:-60,%22name%22:%22Local%22%7D%7D%7D=

Important part is "100_default", not multiple callids I think. Also it marks it as "call":false. Not sure how that affects things.

  "param": {
    "search": {
      "100_default": {
        "id": 43760287,
        "callid": [
          "46075fb3-474a-463e-8f04-74eecab53c96",
          "edd5542d-fd48-4b87-94d3-f66fb192fa69"
        ],
        "uuid": []
      }
    },
    "location": {},
    "transaction": {
      "call": false,
      "registration": false,
      "rest": true
    },

4) This URL doesn't display any data but it appears to fetch data in the background. image

A bit more info on the error: image

homer-app VERSION: 1.3.13

Regarding exact data response you can see from the screenshot above that there is data coming in. Regarding the exact data, I'll go find a smaller response (for some other call) that I can anonymize in reasonable time :-)

kpribic commented 3 years ago

Data response for a non-working scenario, IP addreses/hostnames are replaced, however nothing else is touched: data.response.txt

AlexeyOplachko commented 3 years ago

Couldn't replicate it, but possibly fixed based on error messages you provided, we'll do a release soon, please write back and close issue if it's working for you.

AlexeyOplachko commented 3 years ago

@kpribic we made a release, please check if this issue still occurs. Thank you.

kpribic commented 3 years ago

Better!

To summarize: a call that contained logs and sip messages, after successful correlation and external link generation, has a link that refers only to logs:

  "param": {
    "search": {
      "100_default": {
        "id": 44624074,
        "callid": [
          "5ff36f61-aafc-484d-9277-6b4a6a2928dd"
        ],
        "uuid": []
      }
    },
    "location": {},
    "transaction": {
      "call": false,
      "registration": false,
      "rest": true
    },

Those logs are now properly displayed in UI 7.9.11.

What is exactly the logic behind this? I think this worked differently before, that sip calls was default table that was called.

Correlation back to logs+calls doesn't work for some reason, this could be due to my mappings not working both ways. I'll check this and report back.

kpribic commented 3 years ago

UPDATE: fixed correlating from logs aftrer clicking on link. this was indeed mapping issue on my side.

However, I'm still not clear on why did share link start search with logs? Can this be configured to be calls (SIP) by default if available? This would be a much better user experience, because SIP already has some parsed information shown, while logs doesn't at the moment.

adubovikov commented 3 years ago

Please install homer-app-1.4.0 and test again

adubovikov commented 3 years ago

so, since no feedback, I will close the ticket