From e8190b79e536d2d3a95af2d9ffdf260dddef24fe Mon Sep 17 00:00:00 2001 From: Gerald Begumisa Date: Wed, 21 Jan 2009 12:21:06 +0000 Subject: 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 --- orkaudio/audiocaptureplugins/voip/VoIp.cpp | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'orkaudio/audiocaptureplugins/voip/VoIp.cpp') diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 63fa355..66604dc 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -119,6 +119,18 @@ void memToHex(unsigned char* input, size_t len, CStdString&output) } } +static char* memFindStr(char* toFind, char* start, char* stop) +{ + for(char * ptr = start; (ptr (stop-ptr) ? (stop-ptr) : strlen(toFind))) == 0) + { + return (ptr); + } + } + return NULL; +} + // find the address that follows the given search string between start and stop pointers - case insensitive char* memFindAfter(char* toFind, char* start, char* stop) { @@ -241,6 +253,45 @@ void GrabSipUriDomain(char* in, char* limit, CStdString& out) } } +void GrabSipName(char* in, char* limit, CStdString& out) +{ + char* nameStart = SkipWhitespaces(in, limit); + char* nameEnd = memFindStr("= limit) + { + return; + } + + if(nameEnd == NULL) + { + return; + } + + if(nameEnd <= nameStart) + { + return; + } + + // Get all characters before the m_fromName); + } + char* sipUser = memFindAfter("sip:", fromField, fromFieldEnd); if(sipUser) { @@ -2058,6 +2114,11 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader char* toFieldEnd = GrabLine(toField, sipEnd, to); LOG4CXX_DEBUG(s_sipExtractionLog, "to: " + to); + if(DLLCONFIG.m_sipReportNamesAsTags == true) + { + GrabSipName(toField, toFieldEnd, info->m_toName); + } + char* sipUser = memFindAfter("sip:", toField, toFieldEnd); if(sipUser) { -- cgit v1.2.3