summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2005-12-14 17:30:43 +0000
committerHenri Herscher <henri@oreka.org>2005-12-14 17:30:43 +0000
commita260812d8ee1396c786bd665fc96a6f87878c946 (patch)
tree7d190e82a1f3880f80e22d3650b79e5db3347c72
parentcb587cca9b1f7063fc613b8544a69f94feff5a76 (diff)
Improved SIP logging
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@110 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.cpp14
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.h2
-rw-r--r--orkaudio/audiocaptureplugins/voip/VoIp.cpp11
3 files changed, 21 insertions, 6 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
index 3e8711a..9065eb4 100644
--- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
+++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
@@ -648,7 +648,7 @@ void RtpSessions::Hoover(time_t now)
for (std::list<RtpSessionRef>::iterator it = toDismiss.begin(); it != toDismiss.end() ; it++)
{
RtpSessionRef session = *it;
- LOG4CXX_DEBUG(m_log, session->m_trackingId + ": " + session->m_ipAndPort + " Expired");
+ LOG4CXX_INFO(m_log, session->m_trackingId + ": " + session->m_ipAndPort + " Expired");
Stop(session);
}
@@ -667,8 +667,18 @@ void RtpSessions::Hoover(time_t now)
for (std::list<RtpSessionRef>::iterator it2 = toDismiss.begin(); it2 != toDismiss.end() ; it2++)
{
RtpSessionRef session = *it2;
- LOG4CXX_DEBUG(m_log, session->m_trackingId + ": " + session->m_ipAndPort + " Expired");
+ LOG4CXX_INFO(m_log, session->m_trackingId + ": " + session->m_ipAndPort + " Expired");
Stop(session);
}
}
+//==========================================================
+void SipInviteInfo::ToString(CStdString& string)
+{
+ char fromIp[16];
+ ACE_OS::inet_ntop(AF_INET, (void*)&m_fromIp, fromIp, sizeof(fromIp));
+
+ string.Format("from:%s %s,%s to:%s callid:%s", m_from, fromIp, m_fromRtpPort, m_to, m_callId);
+}
+
+
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.h b/orkaudio/audiocaptureplugins/voip/RtpSession.h
index 41a25bd..cf6844a 100644
--- a/orkaudio/audiocaptureplugins/voip/RtpSession.h
+++ b/orkaudio/audiocaptureplugins/voip/RtpSession.h
@@ -23,6 +23,8 @@
class SipInviteInfo
{
public:
+ void ToString(CStdString& string);
+
struct in_addr m_fromIp;
CStdString m_fromRtpPort;
CStdString m_from;
diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp
index ce2f883..a7241d5 100644
--- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp
+++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp
@@ -210,7 +210,7 @@ bool TrySipBye(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader, U
GrabToken(callIdField, info.m_callId);
RtpSessionsSingleton::instance()->ReportSipBye(info);
}
- LOG4CXX_DEBUG(s_sipPacketLog, "SIP BYE");
+ LOG4CXX_INFO(s_sipPacketLog, "BYE: callid:" + info.m_callId);
}
return result;
}
@@ -238,7 +238,7 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader
{
CStdString from;
GrabLine(fromField, sipEnd, from);
- s_sipExtractionLog->forcedLog(Level::DEBUG, "from: " + from);
+ LOG4CXX_DEBUG(s_sipExtractionLog, "from: " + from);
}
char* fromFieldEnd = memFindEOL(fromField, sipEnd);
@@ -261,7 +261,7 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader
{
CStdString to;
toFieldEnd = GrabLine(toField, sipEnd, to);
- s_sipExtractionLog->forcedLog(Level::DEBUG, "to: " + to);
+ LOG4CXX_DEBUG(s_sipExtractionLog, "to: " + to);
}
char* sipUser = memFindAfter("sip:", toField, toFieldEnd);
@@ -286,7 +286,10 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader
info->m_fromIp = ipHeader->ip_src;
RtpSessionsSingleton::instance()->ReportSipInvite(info);
}
- LOG4CXX_DEBUG(s_sipPacketLog, "SIP INVITE");
+ CStdString logMsg;
+ info->ToString(logMsg);
+ logMsg = "INVITE: " + logMsg;
+ LOG4CXX_INFO(s_sipPacketLog, logMsg);
}
return result;
}