summaryrefslogtreecommitdiff
path: root/orkaudio/audiocaptureplugins
diff options
context:
space:
mode:
authorGerald Begumisa <ben_g@users.sourceforge.net>2007-11-26 14:36:52 +0000
committerGerald Begumisa <ben_g@users.sourceforge.net>2007-11-26 14:36:52 +0000
commit9262281324819ec39f5c65ab29e6310fe737c104 (patch)
treee6b304bef783121869c3a6d9592b2b0482c029a1 /orkaudio/audiocaptureplugins
parentbc9e02f50ffb374715994d4320faace5d8875576 (diff)
Improved SIP error packet logging to include information from the session's INVITE where possible
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@510 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/audiocaptureplugins')
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.cpp21
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.h3
-rw-r--r--orkaudio/audiocaptureplugins/voip/VoIp.cpp7
3 files changed, 26 insertions, 5 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
index 82d1d0d..51024fa 100644
--- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
+++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
@@ -830,6 +830,12 @@ void RtpSession::ReportSipErrorPacket(SipFailureMessageInfoRef& info)
event->m_key = CStdString("failed");
event->m_value = CStdString("true");
g_captureEventCallBack(event, m_capturePort);
+
+ // Do the logging
+ CStdString sipError;
+
+ info->ToString(sipError, m_invite);
+ LOG4CXX_INFO(m_log, "[" + m_trackingId + "] SIP Error packet: " + sipError);
}
int RtpSession::ProtocolToEnum(CStdString& protocol)
@@ -1914,7 +1920,20 @@ void SipFailureMessageInfo::ToString(CStdString& string)
ACE_OS::inet_ntop(AF_INET, (void*)&m_senderIp, senderIp, sizeof(senderIp));
ACE_OS::inet_ntop(AF_INET, (void*)&m_receiverIp, receiverIp, sizeof(receiverIp));
- string.Format("sender:%s rcvr:%s smac:%s rmac:%s callid:%s errorcode:%s errorstr:\"%s\"", senderIp, receiverIp, senderMac, receiverMac, m_callId, m_errorCode, m_errorString);
+ string.Format("sender:%s rcvr:%s smac:%s rmac:%s callid:%s errorcode:%s reason:\"%s\"", senderIp, receiverIp, senderMac, receiverMac, m_callId, m_errorCode, m_errorString);
+}
+
+void SipFailureMessageInfo::ToString(CStdString& string, SipInviteInfoRef inviteInfo)
+{
+ char senderIp[16], receiverIp[16];
+ CStdString senderMac, receiverMac;
+
+ MemMacToHumanReadable((unsigned char*)m_senderMac, senderMac);
+ MemMacToHumanReadable((unsigned char*)m_receiverMac, receiverMac);
+ ACE_OS::inet_ntop(AF_INET, (void*)&m_senderIp, senderIp, sizeof(senderIp));
+ ACE_OS::inet_ntop(AF_INET, (void*)&m_receiverIp, receiverIp, sizeof(receiverIp));
+
+ string.Format("sender:%s from:%s to:%s rcvr:%s callid:%s errorcode:%s reason:\"%s\"", senderIp, inviteInfo->m_from, inviteInfo->m_to, receiverIp, inviteInfo->m_callId, m_errorCode, m_errorString);
}
Sip200OkInfo::Sip200OkInfo()
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.h b/orkaudio/audiocaptureplugins/voip/RtpSession.h
index e8d9f3f..392d7bf 100644
--- a/orkaudio/audiocaptureplugins/voip/RtpSession.h
+++ b/orkaudio/audiocaptureplugins/voip/RtpSession.h
@@ -53,7 +53,8 @@ class SipFailureMessageInfo
{
public:
SipFailureMessageInfo();
- void ToString(CStdString& string);
+ virtual void ToString(CStdString& string);
+ virtual void ToString(CStdString& string, SipInviteInfoRef inviteInfo);
struct in_addr m_senderIp;
struct in_addr m_receiverIp;
diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp
index 4fdfeb0..7504272 100644
--- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp
+++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp
@@ -1214,10 +1214,11 @@ bool TryLogFailedSip(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHea
info->m_errorCode = errorCode;
info->m_errorString = errorString;
- CStdString sipError;
+ // Logging is done in RtpSessions.cpp
+ //CStdString sipError;
- info->ToString(sipError);
- LOG4CXX_INFO(s_sipPacketLog, "SIP Error packet: " + sipError);
+ //info->ToString(sipError);
+ //LOG4CXX_INFO(s_sipPacketLog, "SIP Error packet: " + sipError);
RtpSessionsSingleton::instance()->ReportSipErrorPacket(info);