Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlegID = other (non X-CID) #31

Closed
games130 opened this issue Apr 10, 2018 · 11 comments
Closed

AlegID = other (non X-CID) #31

games130 opened this issue Apr 10, 2018 · 11 comments

Comments

@games130
Copy link
Contributor

I am doing call correlation using the header "P-Charging-Vector" - inside this have a field ICID which is constant throughout the call.
Therefore in the heplify-server.toml, i configured:
AlegID = "P-Charging-Vector"

Based on the captured sip messages in mysql, the callid_aleg column is always empty

example of the header P-Charging-Vector:
P-Charging-Vector: icid-value="d335f5981ed702c414843f092aca5660.3732318005.2962603871.301"

from kamailio, what is did was set the kamailio.cfg with
modparam("sipcapture", "callid_aleg_header", "P-Charging-Vector")

In the callid_aleg column i would get the value of icid-value="d335f5981ed702c414843f092aca5660.3732318005.2962603871.301"

@games130
Copy link
Contributor Author

So i was doing quick search in the sipparser, Is it correct to say this wont be working because the sipparser does not parse the header P-Charging-Vector?

@lmangani
Copy link
Member

Thanks for the report @games130 we'll look into this and provide feedback.

@negbie
Copy link
Member

negbie commented Apr 10, 2018

Well first of all you are right and at the moment I don't look at the P-Charging-Vector header. But still when I would parse it the AlegID handling needs more love.

I removed it with this commit:
6d6a815

  •   for _, v := range h.SIP.Headers {
    
  •   	if v.Header == config.Setting.AlegID {
    
  •   		h.AlegID = v.Val
    
  •   	}
    
  •   }
    

At this time I wrote inside the sipparser every header+value inside an header array so I could easily iterate through it
https://github.com/negbie/sipparser/blob/master/parser.go#L261

This was working fine but I was looking for a more idomatic way to do this and so I temporaly removed it.

I am open for suggestions how to do this nicely

@negbie
Copy link
Member

negbie commented Apr 10, 2018

As a quick fix since I am on mobile I put a new case into the parser that will use the value of "P-Charging-Vector" as callid_aleg as long there is no
s.hdr == "X-CID" || s.hdr == "x-cid" || s.hdr == "XCall-ID" || s.hdr == "XCall-Id":

header in the sip message.

@lmangani
Copy link
Member

@negbie go back to holidays before you get punched! hahah ;)

sounds like in the future this perhaps could be handled from a config list, the same way we do for Prometheus IP groups in order of priority?

@negbie
Copy link
Member

negbie commented Apr 10, 2018

Hehe its hard to go in offline holiday mode but I will try ;) This sounds like a possible solution.

@lmangani
Copy link
Member

Seems toml supports proper arrays as well:

correlation_headers = [
  "X-CID",
  "x-cid",
  "XCall-ID",
  "P-Charging-Vector"
]

@games130
Copy link
Contributor Author

Tested the quick fix, working well now. I am able to get the value correctly (like how i was getting when using kamailio).

@lmangani for the toml, is that something for future development? meaning that it will get the header based on the toml file?

@negbie
Copy link
Member

negbie commented Jun 25, 2018

@games130 please have a look at this issue #84
AlegID has changed to AlegIDs and I removed the hardcoded P-Charging-Vector header.

@games130
Copy link
Contributor Author

@negbie okay will get the latest and let you know the test result. hopefully by this week.

@games130
Copy link
Contributor Author

tested with the new changes, "P-Charging-Vector" for the AlegIDs is working well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants