sipcapture / homer-app

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

URL searching for correlation_id #524

Closed gmaruzz closed 1 year ago

gmaruzz commented 1 year ago

Hello,

huge thanks for this superb software, that helps us all!

Having setup correlation_id to be 'X-cid' in mappings, and having it correctly searchable in field "Correlation ID" of the GUI, is there a way to build an URL (like in share link) that would display a search on correlation_id?

(eg, instead of specifying all session_ids, just specify the correlation_id in URL, and all related calls will be displayed - like if we input the correlation_id in the webgui)

ideally: http://192.168.1.3:9080/search/result?{"param":{"search":{"1_call":{"correlation_id":["412d73224fe5eb33aa606c26a40c2bf3@87.133.3.77"]}}}}=

adubovikov commented 1 year ago

image

and you can replace call_id to correlation_id:

http://homer.com/search/result?{"timestamp":{"from":1686126213000,"to":1686126813000},"param":{"search":{"1_call":{"id":42073,"correlation_id":["aFL3J9BH-412d73224fe5eb33aa606c26a40c2bf3@87.133.3.77"],"uuid":[]}},"location":{},"transaction":{"call":true,"registration":false,"rest":false},"id":{},"timezone":{"value":-180,"name":"Local"}}}

gmaruzz commented 1 year ago

wow, that was fast!!

but... it does not work for me :(

it returns all the calls, like when you search for an unexisting identifier (eg, Zcallid) :(

NOT WORKS: http://192.168.1.3:9080/search/result?%7B%22timestamp%22:%7B%22from%22:1687348090034,%22to%22:1687348690034%7D,%22param%22:%7B%22search%22:%7B%221_call%22:%7B%22id%22:64620,%22correlation_id%22:%5B%220ca35d39-8acd-123c-ab95-fa163ef0535d%22%5D,%22uuid%22:%5B%5D%7D%7D,%22location%22:%7B%7D,%22transaction%22:%7B%22call%22:true,%22registration%22:false,%22rest%22:false%7D,%22id%22:%7B%7D,%22timezone%22:%7B%22value%22:-180,%22name%22:%22Local%22%7D%7D%7D=

NOT WORKS: http://192.168.1.3:9080/search/result?%7B%22timestamp%22:%7B%22from%22:1687348090034,%22to%22:1687348690034%7D,%22param%22:%7B%22search%22:%7B%221_call%22:%7B%22id%22:64620,%22Zcallid%22:%5B%220ca35d39-8acd-123c-ab95-fa163ef0535d%22%5D,%22uuid%22:%5B%5D%7D%7D,%22location%22:%7B%7D,%22transaction%22:%7B%22call%22:true,%22registration%22:false,%22rest%22:false%7D,%22id%22:%7B%7D,%22timezone%22:%7B%22value%22:-180,%22name%22:%22Local%22%7D%7D%7D=

WORKS: http://192.168.1.3:9080/search/result?%7B%22timestamp%22:%7B%22from%22:1687348090034,%22to%22:1687348690034%7D,%22param%22:%7B%22search%22:%7B%221_call%22:%7B%22id%22:64620,%22callid%22:%5B%220ca35d39-8acd-123c-ab95-fa163ef0535d%22%5D,%22uuid%22:%5B%5D%7D%7D,%22location%22:%7B%7D,%22transaction%22:%7B%22call%22:true,%22registration%22:false,%22rest%22:false%7D,%22id%22:%7B%7D,%22timezone%22:%7B%22value%22:-180,%22name%22:%22Local%22%7D%7D%7D=

adubovikov commented 1 year ago

@gmaruzz moment, let me tell you the correct URL

lmangani commented 1 year ago

Please uudecode for best results ;) none of us is a browser

NOT WORKING:

{
  "timestamp": {
    "from": 1687348090034,
    "to": 1687348690034
  },
  "param": {
    "search": {
      "1_call": {
        "id": 64620,
        "correlation_id": [
          "0ca35d39-8acd-123c-ab95-fa163ef0535d"
        ],
        "uuid": []
      }
    },
    "location": {},
    "transaction": {
      "call": true,
      "registration": false,
      "rest": false
    },
    "id": {},
    "timezone": {
      "value": -180,
      "name": "Local"
    }
  }
}

WORKING:

{
  "timestamp": {
    "from": 1687348090034,
    "to": 1687348690034
  },
  "param": {
    "search": {
      "1_call": {
        "id": 64620,
        "callid": [
          "0ca35d39-8acd-123c-ab95-fa163ef0535d"
        ],
        "uuid": []
      }
    },
    "location": {},
    "transaction": {
      "call": true,
      "registration": false,
      "rest": false
    },
    "id": {},
    "timezone": {
      "value": -180,
      "name": "Local"
    }
  }
}
adubovikov commented 1 year ago

so, looks like we don't send correlation_id and check only correlation_id. @AlexeyOplachko is working on fix :-)

gmaruzz commented 1 year ago

Thanks a lot, and sorry for the unreadable URLs!

AlexeyOplachko commented 1 year ago

Made a fix, it should now work, one thing to note is that you need to use actual IDs for columns. To simplify process I added tooltip that when you hover over header shows real id for each column I.e. image

gmaruzz commented 1 year ago

Hello Alexey,

so, in this case, it would be "protocol_header.correlation_id":["v8hqq@127.0.0.1"] ?

AlexeyOplachko commented 1 year ago

Here's example of url from my local setup: http://192.168.88.25:4300/search/result?{"timestamp":{"from":1687356866768,"to":1687357466768},"param":{"search":{"1_call":{"protocol_header.correlation_id":["v8hqq@127.0.0.1"]}},"location":{},"transaction":{"call":true,"registration":false,"rest":false},"id":{},"timezone":{"value":-180,"name":"Local"}}}=

So yes, you're correct.

gmaruzz commented 1 year ago

Thanks a lot!!

adubovikov commented 1 year ago

We have uploaded the new version @gmaruzz please update and test

gmaruzz commented 1 year ago

already done

it works perfect!

Thanks Alexey, thanks Alexandr