diff options
Diffstat (limited to 'orkaudio/audiocaptureplugins/voip')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 9 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.h | 1 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIp.cpp | 5 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp | 6 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIpConfig.h | 1 |
5 files changed, 19 insertions, 3 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index 666030d..ec1f37a 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -308,7 +308,6 @@ bool RtpSession::MatchesSipDomain(CStdString& domain) return true; } } - return false; } @@ -622,10 +621,14 @@ void RtpSession::ProcessMetadataSip(RtpPacketInfoRef& rtpPacket) // Only to domain matches ProcessMetadataSipIncoming(); } + else if(MatchesStringList(m_invite->m_userAgent, DLLCONFIG.m_sipDirectionReferenceUserAgents)) + { + ProcessMetadataSipIncoming(); + } else { // Default to outgoing whereby m_from is the local party and m_to is - // the remote party - neither from nor to domains match + // the remote party ProcessMetadataSipOutgoing(); } } @@ -2695,7 +2698,7 @@ void SipInviteInfo::ToString(CStdString& string) MemMacToHumanReadable((unsigned char*)m_senderMac, senderMac); MemMacToHumanReadable((unsigned char*)m_receiverMac, receiverMac); - string.Format("sender:%s from:%s@%s RTP:%s,%s to:%s@%s rcvr:%s callid:%s smac:%s rmac:%s fromname:%s toname:%s", senderIp, m_from, m_fromDomain, fromRtpIp, m_fromRtpPort, m_to, m_toDomain, receiverIp, m_callId, senderMac, receiverMac, m_fromName, m_toName); + string.Format("sender:%s from:%s@%s RTP:%s,%s to:%s@%s rcvr:%s callid:%s smac:%s rmac:%s fromname:%s toname:%s ua:%s", senderIp, m_from, m_fromDomain, fromRtpIp, m_fromRtpPort, m_to, m_toDomain, receiverIp, m_callId, senderMac, receiverMac, m_fromName, m_toName, m_userAgent); } //========================================================== diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.h b/orkaudio/audiocaptureplugins/voip/RtpSession.h index 765b803..221c771 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.h +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.h @@ -49,6 +49,7 @@ public: CStdString m_toDomain; CStdString m_fromName; CStdString m_toName; + CStdString m_userAgent; time_t m_recvTime; }; diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 8c45c51..aa0d811 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -2082,6 +2082,7 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader char* connectionAddressField = NULL; char* attribSendonly = memFindAfter("a=sendonly", (char*)udpPayload, sipEnd); char* rtpmapAttribute = memFindAfter("\na=rtpmap:", (char*)udpPayload, sipEnd); + char* userAgentField = memFindAfter("\nUser-Agent:", (char*)udpPayload, sipEnd); if(DLLCONFIG.m_sipRequestUriAsLocalParty == true) { @@ -2217,6 +2218,10 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader info->m_from = localExtension; } } + if(userAgentField) + { + GrabTokenSkipLeadingWhitespaces(userAgentField, sipEnd, info->m_userAgent); + } if(audioField) { GrabToken(audioField, sipEnd, info->m_fromRtpPort); diff --git a/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp b/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp index 5f4646d..4c3f22d 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp @@ -147,6 +147,8 @@ void VoIpConfig::Define(Serializer* s) s->CsvValue("SipDomains", m_sipDomains); s->CsvValue("SipDirectionReferenceIpAddresses", m_sipDirectionReferenceIpAddresses); + s->CsvValue("SipDirectionReferenceUserAgents", m_sipDirectionReferenceUserAgents); + s->IpRangesValue("LanIpRanges", m_lanIpRanges); s->IpRangesValue("MediaAddressBlockedIpRanges", m_mediaAddressBlockedIpRanges); } @@ -367,6 +369,10 @@ void VoIpConfig::Validate() m_rtcpDetect = true; m_sipExtractFields.push_back(inInVar); } + if(m_sipDirectionReferenceUserAgents.size() == 0) + { + m_sipDirectionReferenceUserAgents.push_back("Asterisk"); + } } bool VoIpConfig::IsPartOfLan(struct in_addr addr) diff --git a/orkaudio/audiocaptureplugins/voip/VoIpConfig.h b/orkaudio/audiocaptureplugins/voip/VoIpConfig.h index 202b92f..3ff66e7 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIpConfig.h +++ b/orkaudio/audiocaptureplugins/voip/VoIpConfig.h @@ -115,6 +115,7 @@ public: int m_skinnyTcpPort; std::list<CStdString> m_sipDomains; std::list<CStdString> m_sipDirectionReferenceIpAddresses; + std::list<CStdString> m_sipDirectionReferenceUserAgents; IpRanges m_lanIpRanges; IpRanges m_mediaAddressBlockedIpRanges; }; |