sipcapture / homer-app

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

3 Legs/call-ids Correlation Mapping #525

Closed idanam-del closed 1 year ago

idanam-del commented 1 year ago

Hey, this the example mapping for a 2 way correlation

Full Example for 2-way correlation Mapping

[
    {
       "source_field": "data_header.callid",
        "lookup_id": 1,
        "lookup_profile": "call",
        "append_sid": true,
        "lookup_field": "data_header->>'X-CID'",
        "lookup_range": [
            -300,
            200
        ]
    },
    {
        "source_field": "data_header.X-CID",
        "lookup_id": 1,
        "lookup_profile": "call",
        "append_sid": true,
        "lookup_field": "data_header->>'X-CID'",
        "lookup_range": [
            -300,
            200
        ]
    },
    {
        "source_field": "data_header.X-CID",
        "lookup_id": 1,
        "lookup_profile": "call",
        "append_sid": true,
        "lookup_field": "data_header->>'callid'",
        "lookup_range": [
            -300,
            200
        ]
    },
    {
        "source_field": "data_header.callid",
        "lookup_id": 1,
        "lookup_profile": "call",
        "lookup_field": "sid",
        "lookup_range": [
            -300,
            200
        ]
    }
]

What would be an example of a 3 way correlation?

  1. Phone -> Sip Server
  2. Sip Server -> SBC
  3. SBC -> Provider
lmangani commented 1 year ago

The mapping and correlation are note related to the number of legs. Just configure all the 1 to 1 relations (two rules for each method/header/etc) and they will be applied in a cascading fashion.

idanam-del commented 1 year ago

@lmangani Thank you, but I realize what is might my issue.

In my setup the X-CID is populated by the callid of the leg A but its changed every time the invite comes from a different server.

As i understand for the correlation to work in a cascading fashion, the x-cid should be populated by the call id of the leg between the phone and Sip server and should be transferred and the cid to be remained all the way to provider.

like in here : https://github.com/sipcapture/homer-app/issues/278

image

lmangani commented 1 year ago

The X-CID is just a pointer to the previous originating SIP session and the concept mandates the same ID being propagated to fork legs. So the same A legs should produce the same X-CID in as many forks as the systems produces for correlation to work. They can cascade, as long as the chain keeps the links you can have as many forks you you want.