slomkowski / mumsi

SIP to Mumble gateway/bridge using PJSUA stack.
Apache License 2.0
41 stars 33 forks source link

problem with IncomingConnectionValidator #12

Closed pzi42 closed 8 years ago

pzi42 commented 8 years ago

Testing mumsi delivers refusing incoming connections.So I checked the regex in "IncomingConnectionValidator::validateUri. I chabged

boost::regex addressRegex("[\"+\w ]_sip:([+\w.]+@[\w.]+)"); to boost::regex addressRegex("[\"+ .\w ]_sip:([+\w.]+@[\w.]+)");

After this validateUri accepts my URIs.

I'not shure about side-effects, or what else could happen with this changed regex. So I want to know whetger my new regex is good enough.

My URI is like: "X. XXXX" sip:99@162.168.1.6 and the original regex does not match on this URI.

slomkowski commented 8 years ago

Your regex uses ., which matches any character. It works, but I came up with safer regex:

boost::regex addressRegex("[\"\\+\\w\\. ]*<?sip:([\\+\\w\\.]+@[\\w\\.]+)>?");

Can you try if it works in your case? It matches the URI you have pasted.

PS. Can you use code syntax when you post code? If you paste it as is, escape characters are lost.

pzi42 commented 8 years ago

Thanks, boost::regex addressRegex("[\"\\+\\w\\. ]*<?sip:([\\+\\w\\.]+@[\\w\\.]+)>?"); works fine

slomkowski commented 8 years ago

I updated regex with commit 35f70f319585f3b8d3f7d2aa9789e4f5c79ea389. I'm closing issue.