Merge pull request #10 from fstern/uri_validation
Match international phone numbers starting with +XX
This commit is contained in:
commit
b01c8a767e
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user