diff options
author | Gerald Begumisa <ben_g@users.sourceforge.net> | 2009-01-21 12:21:06 +0000 |
---|---|---|
committer | Gerald Begumisa <ben_g@users.sourceforge.net> | 2009-01-21 12:21:06 +0000 |
commit | e8190b79e536d2d3a95af2d9ffdf260dddef24fe (patch) | |
tree | 82cdac36b41e2791ebfe637a18a101fa29806991 /orkbasecxx | |
parent | 821d942149fe4f53d01e1a76ff1133bf3ae158ac (diff) |
VoIP plugin has been updated with a new configuration parameter, SipReportNamesAsTags, to be configured under the VoIpPlugin section of config.xml. When set to 'true', the SIP from: and to: names are extracted and reported as tags. The tag keys used are localname and remotename which correspond to the respective localparty and remoteparty values which are already reported. These tags may, therefore, be used when providing custom names to recordings.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@597 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx')
-rw-r--r-- | orkbasecxx/AudioTape.cpp | 5 | ||||
-rw-r--r-- | orkbasecxx/Utils.cpp | 22 | ||||
-rw-r--r-- | orkbasecxx/Utils.h | 2 |
3 files changed, 28 insertions, 1 deletions
diff --git a/orkbasecxx/AudioTape.cpp b/orkbasecxx/AudioTape.cpp index 336f492..fd152fa 100644 --- a/orkbasecxx/AudioTape.cpp +++ b/orkbasecxx/AudioTape.cpp @@ -838,6 +838,11 @@ void AudioTape::GenerateFinalFilePathAndIdentifier() if(fileIdentifier.size() > 0) { + CStdString newFileId; + + FileEscapeName(fileIdentifier, newFileId); + + fileIdentifier = newFileId; m_fileIdentifier = fileIdentifier; } } diff --git a/orkbasecxx/Utils.cpp b/orkbasecxx/Utils.cpp index c06437f..dca2200 100644 --- a/orkbasecxx/Utils.cpp +++ b/orkbasecxx/Utils.cpp @@ -209,6 +209,28 @@ int FileSetOwnership(CStdString filename, CStdString owner, CStdString group) return res; } +static char file_ok_chars[] = "-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"; +static char hex_digits[17] = "0123456789ABCDEF"; + +void FileEscapeName(CStdString& in, CStdString& out) +{ + // Translates all the characters that are not in file_ok_chars string into %xx sequences + // %xx specifies the character ascii code in hexadecimal + out = ""; + for (int i = 0 ; i<in.size() ; i++) + { + if (strchr(file_ok_chars, in.GetAt(i))) + { + out += in.GetAt(i); + } + else + { + out += '%'; + out += hex_digits[((unsigned char) in.GetAt(i)) >> 4]; + out += hex_digits[in.GetAt(i) & 0x0F]; + } + } +} //===================================================== // TcpAddress diff --git a/orkbasecxx/Utils.h b/orkbasecxx/Utils.h index 610823d..31f059d 100644 --- a/orkbasecxx/Utils.h +++ b/orkbasecxx/Utils.h @@ -78,7 +78,7 @@ bool DLL_IMPORT_EXPORT_ORKBASE FileCanOpen(CStdString& path); void DLL_IMPORT_EXPORT_ORKBASE FileRecursiveMkdir(CStdString& path, int permissions, CStdString owner, CStdString group, CStdString rootDirectory); int DLL_IMPORT_EXPORT_ORKBASE FileSetPermissions(CStdString filename, int permissions); int DLL_IMPORT_EXPORT_ORKBASE FileSetOwnership(CStdString filename, CStdString owner, CStdString group); - +void DLL_IMPORT_EXPORT_ORKBASE FileEscapeName(CStdString& in, CStdString& out); //===================================================== // threading related stuff |