[Home]

Summary:ASTERISK-25595: Unescaped : in messge sent to statsd
Reporter:Niklas Larsson (pnlarsson)Labels:
Date Opened:2015-11-27 03:47:14.000-0600Date Closed:2015-12-03 15:53:43.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_pjsip Resources/res_statsd
Versions:13.6.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) statsd.diff
Description:Got this lines in statsd with latest git:

{quote}
27 Nov 10:36:36 - DEBUG: Bad line: 81.93.143.246 in msg "uc01.PJSIP.contacts.ngcore@@sip:81.93.143.246:5060.rtt:1|ms"
27 Nov 10:36:36 - DEBUG: Bad line: 5060.rtt in msg "uc01.PJSIP.contacts.ngcore@@sip:81.93.143.246:5060.rtt:1|ms"
{quote}

need to escape the extra : somehow
Comments:By: Asterisk Team (asteriskteam) 2015-11-27 03:47:17.542-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Matt Jordan (mjordan) 2015-11-30 13:41:37.723-0600

This is definitely an issue for static contacts with a SIP URI.

For dynamic contacts, it's less of an issue, as we already generate a hashed string for the object ID.

Unfortunately, if we want to keep the statsd stuff relatively fast and not intrusive into the basic contact handling, we don't want to bother with a whole mess of escaping every time someone updates a contact's round trip time. That's not going to end well.

The only other thing I can think to do is to hash the object ID and use that as the statsd metric label. That will definitely work; the downside is that you'll have to provide some mapping somewhere between the contact ID and the hashed value, as it won't be very obvious. That kinda stinks, but a quick glance at "pjsip show contacts" will answer the question. So I'll probably go down that road.



By: Matt Jordan (mjordan) 2015-11-30 13:46:13.708-0600

The attached patch (statsd.diff) should make it use a hash. I've also updated the output of the CLI command to dump the hash.