Merge pull request #10 from fstern/uri_validation

Match international phone numbers starting with +XX
This commit is contained in:
Michał Słomkowski 2016-02-14 19:02:19 +01:00
commit b01c8a767e

View File

@ -12,13 +12,13 @@ sip::IncomingConnectionValidator::IncomingConnectionValidator(std::string validU
boost::split(separateUris, validUriExpression, boost::is_any_of("\t "));
for (auto &uri : separateUris) {
boost::replace_all(uri, ".", "\\.");
boost::replace_all(uri, "*", "\\w*");
boost::replace_all(uri, "*", "[\\+\\w]*");
uriRegexVec.push_back(boost::regex(uri));
}
}
bool sip::IncomingConnectionValidator::validateUri(std::string uri) {
boost::regex addressRegex("[\"\\w ]*<sip:([\\w\\.]+@[\\w\\.]+)>");
boost::regex addressRegex("[\"\\+\\w ]*<sip:([\\+\\w\\.]+@[\\w\\.]+)>");
boost::smatch s;