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 /orkaudio/audiocaptureplugins/voip/RtpSession.cpp | |
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 'orkaudio/audiocaptureplugins/voip/RtpSession.cpp')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 83 |
1 files changed, 82 insertions, 1 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index ec8073d..92cc1f0 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -331,6 +331,19 @@ void RtpSession::ProcessMetadataSipIncoming() { m_remoteParty = m_invite->m_from; m_localParty = m_invite->m_to; + + m_remotePartyName = m_invite->m_fromName; + m_localPartyName = m_invite->m_toName; + + if(!m_remotePartyName.size()) + { + m_remotePartyName = m_remoteParty; + } + if(!m_localPartyName.size()) + { + m_localPartyName = m_localParty; + } + m_direction = CaptureEvent::DirIn; char szInviteeIp[16]; ACE_OS::inet_ntop(AF_INET, (void*)&m_inviteeIp, szInviteeIp, sizeof(szInviteeIp)); @@ -346,6 +359,19 @@ void RtpSession::ProcessMetadataSipOutgoing() { m_remoteParty = m_invite->m_to; m_localParty = m_invite->m_from; + + m_remotePartyName = m_invite->m_toName; + m_localPartyName = m_invite->m_fromName; + + if(!m_remotePartyName.size()) + { + m_remotePartyName = m_remoteParty; + } + if(!m_localPartyName.size()) + { + m_localPartyName = m_localParty; + } + m_direction = CaptureEvent::DirOut; char szInvitorIp[16]; ACE_OS::inet_ntop(AF_INET, (void*)&m_invitorIp, szInvitorIp, sizeof(szInvitorIp)); @@ -420,6 +446,19 @@ void RtpSession::UpdateMetadataSip(RtpPacketInfoRef& rtpPacket, bool sourceRtpAd // Update session metadata with INVITE info m_remoteParty = invite->m_from; m_localParty = invite->m_to; + + m_remotePartyName = m_invite->m_fromName; + m_localPartyName = m_invite->m_toName; + + if(!m_remotePartyName.size()) + { + m_remotePartyName = m_remoteParty; + } + if(!m_localPartyName.size()) + { + m_localPartyName = m_localParty; + } + m_localIp = invite->m_receiverIp; memcpy(m_localMac, invite->m_receiverMac, sizeof(m_localMac)); @@ -444,6 +483,27 @@ void RtpSession::UpdateMetadataSip(RtpPacketInfoRef& rtpPacket, bool sourceRtpAd event->m_value = m_remoteParty; g_captureEventCallBack(event, m_capturePort); + if(DLLCONFIG.m_sipReportNamesAsTags == true) + { + CStdString key, value; + + key = "localname"; + value = m_localPartyName; + event.reset(new CaptureEvent()); + event->m_type = CaptureEvent::EtKeyValue; + event->m_key = key; + event->m_value = value; + g_captureEventCallBack(event, m_capturePort); + + key = "remotename"; + value = m_remotePartyName; + event.reset(new CaptureEvent()); + event->m_type = CaptureEvent::EtKeyValue; + event->m_key = key; + event->m_value = value; + g_captureEventCallBack(event, m_capturePort); + } + // Report Local IP char szLocalIp[16]; ACE_OS::inet_ntop(AF_INET, (void*)&m_localIp, szLocalIp, sizeof(szLocalIp)); @@ -633,6 +693,27 @@ void RtpSession::ReportMetadata() g_captureEventCallBack(event, m_capturePort); m_remotePartyReported = true; + if(DLLCONFIG.m_sipReportNamesAsTags == true) + { + CStdString key, value; + + key = "localname"; + value = m_localPartyName; + event.reset(new CaptureEvent()); + event->m_type = CaptureEvent::EtKeyValue; + event->m_key = key; + event->m_value = value; + g_captureEventCallBack(event, m_capturePort); + + key = "remotename"; + value = m_remotePartyName; + event.reset(new CaptureEvent()); + event->m_type = CaptureEvent::EtKeyValue; + event->m_key = key; + event->m_value = value; + g_captureEventCallBack(event, m_capturePort); + } + // Report direction event.reset(new CaptureEvent()); event->m_type = CaptureEvent::EtDirection; @@ -2531,7 +2612,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", senderIp, m_from, m_fromDomain, fromRtpIp, m_fromRtpPort, m_to, m_toDomain, receiverIp, m_callId, senderMac, 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); } //========================================================== |