diff options
author | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-03-06 17:52:46 +0000 |
---|---|---|
committer | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-03-06 17:52:46 +0000 |
commit | c8218d259f148e5eb267369a2e508d43570291c0 (patch) | |
tree | 7b6b1243e3e72dc5efa3f24704226e4ff72cb1a0 /orkaudio/audiocaptureplugins/voip/VoIp.cpp | |
parent | 0937742d2f5689c93efca3a5a56e8b36f81152c7 (diff) |
Changed the way direction is determined while recording SIP-based VoIP sessions. A new configuration parameter, SipDomains, has been created and should be set under the VoIpPlugin section in config.xml. This parameter should contain a comma separated list of domains. So, if the domain of the SIP "from" URI matches any entry in this list, direction is set to "out". If the domain of the SIP "to" URI matches any entry in this list, direction is set to "in". If both domains of the "from" and "to" URIs match entries in this list, direction is set to "out" which is also the default case.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@527 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/audiocaptureplugins/voip/VoIp.cpp')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIp.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 03725c9..a2a07a4 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -196,6 +196,32 @@ char* SkipWhitespaces(char* in, char* limit) return c; } +void GrabSipUriDomain(char* in, char* limit, CStdString& out) +{ + char* userStart = SkipWhitespaces(in, limit); + if(userStart >= limit) + { + return; + } + + char* domainStart = strchr(userStart, '@'); + if(!domainStart) + { + return; + } + + domainStart += 1; + if(*domainStart == '\0' || domainStart >= limit) + { + return; + } + + for(char *c = domainStart; (ACE_OS::ace_isalnum(*c) || *c == '.' || *c == '-' || *c == '_') && (c < limit); c = c+1) + { + out += *c; + } +} + void GrabSipUserAddress(char* in, char* limit, CStdString& out) { char* userStart = SkipWhitespaces(in, limit); @@ -1613,6 +1639,7 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader { GrabSipUriUser(sipUser, fromFieldEnd, info->m_from); } + GrabSipUriDomain(sipUser, fromFieldEnd, info->m_fromDomain); } else { @@ -1624,6 +1651,7 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader { GrabSipUriUser(fromField, fromFieldEnd, info->m_from); } + GrabSipUriDomain(fromField, fromFieldEnd, info->m_fromDomain); } } if(toField) @@ -1643,6 +1671,7 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader { GrabSipUriUser(sipUser, toFieldEnd, info->m_to); } + GrabSipUriDomain(sipUser, toFieldEnd, info->m_toDomain); } else { @@ -1654,6 +1683,7 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader { GrabSipUriUser(toField, toFieldEnd, info->m_to); } + GrabSipUriDomain(toField, toFieldEnd, info->m_toDomain); } } if(callIdField) |