mirror of
https://github.com/jambonz/freeswitch-modules.git
synced 2025-12-19 09:07:44 +00:00
mod audio fork cannot parse ws:<IP>/call path (#40)
* mod audio fork cannot parse ws:<IP>/call path Signed-off-by: Quan HL <quan.luuhoang8@gmail.com> * add comments for the regex Signed-off-by: Quan HL <quan.luuhoang8@gmail.com> * add comments for the regex Signed-off-by: Quan HL <quan.luuhoang8@gmail.com> --------- Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>
This commit is contained in:
@@ -419,7 +419,10 @@ extern "C" {
|
||||
}
|
||||
|
||||
std::string strHost(server + offset);
|
||||
std::regex re("^(.+?):?(\\d+)?(/.*)?$");
|
||||
//- `([^/:]+)` captures the hostname/IP address, match any character except in the set
|
||||
//- `:?([0-9]*)?` optionally captures a colon and the port number, if it's present.
|
||||
//- `(/.*)` captures everything else (the path).
|
||||
std::regex re("([^/:]+):?([0-9]*)?(/.*)?$");
|
||||
std::smatch matches;
|
||||
if(std::regex_search(strHost, matches, re)) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user