diff options
author | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-07-01 20:44:04 +0000 |
---|---|---|
committer | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-07-01 20:44:04 +0000 |
commit | 8971a80d7afa112ebe8a75e7edeac5f7d98ab759 (patch) | |
tree | c778cb553483970576c36926c8ad01bcdc3f22a2 /orkaudio/audiocaptureplugins/voip/VoIp.cpp | |
parent | 54517da801e2afae241fd02ab84a34add755c149 (diff) |
A new configuration parameter, SkinnyNameAsLocalParty, has been added for the VoIpConfig section in config.xml. When this parameter is set to true, the local party is reported as a name and not telephone number, where available in Skinny sessions. Another configuration parameter, SkinnyReportTags, has been added for the VoIpConfig section in config.xml. This parameter should be populated with a comma-separated list of Skinny variables to report. Initially supported values are 'localpartyname' and 'callmanager'.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@549 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/audiocaptureplugins/voip/VoIp.cpp')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIp.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 130c720..0af85b5 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -146,6 +146,16 @@ void GrabToken(char* in, char* limit, CStdString& out) } } +// Same as GrabToken but includes spaces in the token grabbed as opposed to stopping +// when a space is encountered +void GrabTokenAcceptSpace(char* in, char* limit, CStdString& out) +{ + for(char* c = in; *c != '\0' && *c != 0x0D && *c != 0x0A && c<limit; c = c+1) + { + out += *c; + } +} + // Same as GrabToken but skipping leading whitespaces void GrabTokenSkipLeadingWhitespaces(char* in, char* limit, CStdString& out) { @@ -1907,6 +1917,23 @@ void HandleSkinnyMessage(SkinnyHeaderStruct* skinnyHeader, IpHeaderStruct* ipHea GrabToken(parties, parties+SKINNY_CCM5_PARTIES_BLOCK_SIZE, callingParty); CStdString calledParty; GrabToken(parties+callingParty.size()+1, parties+SKINNY_CCM5_PARTIES_BLOCK_SIZE, calledParty); + CStdString callingPartyName; + + if(DLLCONFIG.m_skinnyNameAsLocalParty) + { + // It appears that the calling party name is the 9th token + int tokenNr = 0; + char *partiesPtr = NULL; + + partiesPtr = parties; + while(tokenNr < 9 && partiesPtr < parties+SKINNY_CCM5_PARTIES_BLOCK_SIZE) + { + callingPartyName = ""; + GrabTokenAcceptSpace(partiesPtr, parties+SKINNY_CCM5_PARTIES_BLOCK_SIZE, callingPartyName); + partiesPtr += callingPartyName.size() + 1; + tokenNr += 1; + } + } // Emulate a regular CCM CallInfo message SkCallInfoStruct callInfo; @@ -1916,7 +1943,23 @@ void HandleSkinnyMessage(SkinnyHeaderStruct* skinnyHeader, IpHeaderStruct* ipHea callInfo.callType = ccm5CallInfo->callType; callInfo.lineInstance = 0; callInfo.calledPartyName[0] = '\0'; - callInfo.callingPartyName[0] = '\0'; + + if(DLLCONFIG.m_skinnyNameAsLocalParty) + { + if(callingPartyName.size()) + { + strncpy(callInfo.callingPartyName, (PCSTR)callingPartyName, sizeof(callInfo.callingPartyName)); + } + else + { + callInfo.callingPartyName[0] = '\0'; + } + } + else + { + callInfo.callingPartyName[0] = '\0'; + } + if(s_skinnyPacketLog->isInfoEnabled()) { logMsg.Format(" CallId:%u calling:%s called:%s", callInfo.callId, callInfo.callingParty, callInfo.calledParty); |