From 87856bf5f56d2597209b7ed768f5096559e0587b Mon Sep 17 00:00:00 2001 From: Gerald Begumisa Date: Wed, 30 May 2007 15:41:39 +0000 Subject: Fix for correct Skinny on-hold handling. Now, only one recording is created when an endpoint goes on hold then returns. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@441 09dcff7a-b715-0410-9601-b79a96267cd0 --- .../audiocaptureplugins/voip/PacketHeaderDefs.cpp | 179 +++++++++++++++++++++ .../audiocaptureplugins/voip/PacketHeaderDefs.h | 65 ++++++++ orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 140 ++++++++++++++-- orkaudio/audiocaptureplugins/voip/RtpSession.h | 5 + orkaudio/audiocaptureplugins/voip/VoIp.cpp | 38 +++++ orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp | 8 + orkaudio/audiocaptureplugins/voip/VoIpConfig.h | 1 + 7 files changed, 427 insertions(+), 9 deletions(-) (limited to 'orkaudio/audiocaptureplugins') diff --git a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp index 123282e..efc9396 100644 --- a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp +++ b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp @@ -31,6 +31,10 @@ int SkinnyMessageToEnum(CStdString& msg) { msgEnum = SkCcm5CallInfoMessage; } + else if (msg.CompareNoCase(SKINNY_MSG_SOFT_KEY_EVENT_MESSAGE) == 0) + { + msgEnum = SkSoftKeyEventMessage; + } return msgEnum; } @@ -60,6 +64,9 @@ CStdString SkinnyMessageToString(int msgEnum) case SkCcm5CallInfoMessage: msgString = SKINNY_MSG_CCM5_CALL_INFO_MESSAGE; break; + case SkSoftKeyEventMessage: + msgString = SKINNY_MSG_SOFT_KEY_EVENT_MESSAGE; + break; default: msgString = SKINNY_MSG_UNKN; } @@ -176,3 +183,175 @@ bool SkinnyValidateLineStat(SkLineStatStruct* lineStat) return valid; } +bool SkinnyValidateSoftKeyEvent(SkSoftKeyEventMessageStruct* softKeyEvent) +{ + bool valid = true; + + if(softKeyEvent->soft_key_event > SKINNY_SOFTKEY_MAX_EVENT || + softKeyEvent->soft_key_event < SKINNY_SOFTKEY_MIN_EVENT) + { + valid = false; + } + + return valid; +} + +//=================================================================== +int SoftKeyEvent::SoftKeyEventToEnum(CStdString& event) +{ + int skEnum = SkSoftKeyUnkn; + + if(event.CompareNoCase(SKINNY_SOFTKEY_REDIAL) == 0) + { + skEnum = SkSoftKeyRedial; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_NEWCALL) == 0) + { + skEnum = SkSoftKeyNewCall; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_HOLD) == 0) + { + skEnum = SkSoftKeyHold; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_TRNSFER) == 0) + { + skEnum = SkSoftKeyTrnsfer; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_CFWDALL) == 0) + { + skEnum = SkSoftKeyCFwdAll; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_CFWDBUSY) == 0) + { + skEnum = SkSoftKeyCFwdBusy; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_CFWDNOANSWER) == 0) + { + skEnum = SkSoftKeyCFwdNoAnswer; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_BACKSPACE) == 0) + { + skEnum = SkSoftKeyBackSpace; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_ENDCALL) == 0) + { + skEnum = SkSoftKeyEndCall; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_RESUME) == 0) + { + skEnum = SkSoftKeyResume; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_ANSWER) == 0) + { + skEnum = SkSoftKeyAnswer; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_INFO) == 0) + { + skEnum = SkSoftKeyInfo; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_CONFRN) == 0) + { + skEnum = SkSoftKeyConfrn; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_PARK) == 0) + { + skEnum = SkSoftKeyPark; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_JOIN) == 0) + { + skEnum = SkSoftKeyJoin; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_MEETMECONFRN) == 0) + { + skEnum = SkSoftKeyConfrn; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_PARK) == 0) + { + skEnum = SkSoftKeyPark; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_JOIN) == 0) + { + skEnum = SkSoftKeyJoin; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_MEETMECONFRN) == 0) + { + skEnum = SkSoftKeyMeetMeConfrn; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_CALLPICKUP) == 0) + { + skEnum = SkSoftKeyCallPickUp; + } + else if(event.CompareNoCase(SKINNY_SOFTKEY_GRPCALLPICKUP) == 0) + { + skEnum = SkSoftKeyGrpCallPickUp; + } + + return skEnum; +} + +CStdString SoftKeyEvent::SoftKeyEventToString(int event) +{ + CStdString msgString; + + switch(event) { + case SkSoftKeyRedial: + msgString = SKINNY_SOFTKEY_REDIAL; + break; + case SkSoftKeyNewCall: + msgString = SKINNY_SOFTKEY_NEWCALL; + break; + case SkSoftKeyHold: + msgString = SKINNY_SOFTKEY_HOLD; + break; + case SkSoftKeyTrnsfer: + msgString = SKINNY_SOFTKEY_TRNSFER; + break; + case SkSoftKeyCFwdAll: + msgString = SKINNY_SOFTKEY_CFWDALL; + break; + case SkSoftKeyCFwdBusy: + msgString = SKINNY_SOFTKEY_CFWDBUSY; + break; + case SkSoftKeyCFwdNoAnswer: + msgString = SKINNY_SOFTKEY_CFWDNOANSWER; + break; + case SkSoftKeyBackSpace: + msgString = SKINNY_SOFTKEY_BACKSPACE; + break; + case SkSoftKeyEndCall: + msgString = SKINNY_SOFTKEY_ENDCALL; + break; + case SkSoftKeyResume: + msgString = SKINNY_SOFTKEY_RESUME; + break; + case SkSoftKeyAnswer: + msgString = SKINNY_SOFTKEY_ANSWER; + break; + case SkSoftKeyInfo: + msgString = SKINNY_SOFTKEY_INFO; + break; + case SkSoftKeyConfrn: + msgString = SKINNY_SOFTKEY_CONFRN; + break; + case SkSoftKeyPark: + msgString = SKINNY_SOFTKEY_PARK; + break; + case SkSoftKeyJoin: + msgString = SKINNY_SOFTKEY_JOIN; + break; + case SkSoftKeyMeetMeConfrn: + msgString = SKINNY_SOFTKEY_MEETMECONFRN; + break; + case SkSoftKeyCallPickUp: + msgString = SKINNY_SOFTKEY_CALLPICKUP; + break; + case SkSoftKeyGrpCallPickUp: + msgString = SKINNY_SOFTKEY_GRPCALLPICKUP; + break; + default: + msgString = SKINNY_SOFTKEY_UNKN; + break; + } + + return msgString; +} diff --git a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h index 9468c1f..982021c 100644 --- a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h +++ b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h @@ -185,6 +185,15 @@ typedef struct bool SkinnyValidateOpenReceiveChannelAck(SkOpenReceiveChannelAckStruct *); +typedef struct +{ + SkinnyHeaderStruct header; + unsigned long soft_key_event; + unsigned long line_instance; + unsigned long call_identifier; +} SkSoftKeyEventMessageStruct; + +bool SkinnyValidateSoftKeyEvent(SkSoftKeyEventMessageStruct *); #define SKINNY_CTRL_PORT 2000 #define SKINNY_MIN_MESSAGE_SIZE 12 @@ -198,6 +207,7 @@ bool SkinnyValidateOpenReceiveChannelAck(SkOpenReceiveChannelAckStruct *); #define SKINNY_MSG_OPEN_RECEIVE_CHANNEL_ACK "OpenReceiveChannelAck" #define SKINNY_MSG_LINE_STAT_MESSAGE "LineStatMessage" #define SKINNY_MSG_CCM5_CALL_INFO_MESSAGE "Ccm5CallInfoMessage" +#define SKINNY_MSG_SOFT_KEY_EVENT_MESSAGE "SoftKeyEventMessage" #define SKINNY_CALL_TYPE_INBOUND 1 #define SKINNY_CALL_TYPE_OUTBOUND 2 @@ -212,11 +222,66 @@ typedef enum SkLineStatMessage = 0x0092, SkCloseReceiveChannel = 0x0106, SkCcm5CallInfoMessage = 0x14A, + SkSoftKeyEventMessage = 0x0026, SkUnkn = 0x0 } SkinnyMessageEnum; int SkinnyMessageToEnum(CStdString& msg); CStdString SkinnyMessageToString(int msgEnum); +#define SKINNY_SOFTKEY_MAX_EVENT 18 +#define SKINNY_SOFTKEY_MIN_EVENT 1 + +class SoftKeyEvent +{ +public: +#define SKINNY_SOFTKEY_REDIAL "Redial" +#define SKINNY_SOFTKEY_NEWCALL "NewCall" +#define SKINNY_SOFTKEY_HOLD "Hold" +#define SKINNY_SOFTKEY_TRNSFER "Trnsfer" +#define SKINNY_SOFTKEY_CFWDALL "CFwdAll" +#define SKINNY_SOFTKEY_CFWDBUSY "CFwdBusy" +#define SKINNY_SOFTKEY_CFWDNOANSWER "CFwdNoAnswer" +#define SKINNY_SOFTKEY_BACKSPACE "BackSpace" +#define SKINNY_SOFTKEY_ENDCALL "EndCall" +#define SKINNY_SOFTKEY_RESUME "Resume" +#define SKINNY_SOFTKEY_ANSWER "Answer" +#define SKINNY_SOFTKEY_INFO "Info" +#define SKINNY_SOFTKEY_CONFRN "Confrn" +#define SKINNY_SOFTKEY_PARK "Park" +#define SKINNY_SOFTKEY_JOIN "Join" +#define SKINNY_SOFTKEY_MEETMECONFRN "MeetMeConfrn" +#define SKINNY_SOFTKEY_CALLPICKUP "CallPickUp" +#define SKINNY_SOFTKEY_GRPCALLPICKUP "GrpCallPickUp" +#define SKINNY_SOFTKEY_UNKN "Unknown" + + typedef enum { + SkSoftKeyRedial = 1, + SkSoftKeyNewCall = 2, + SkSoftKeyHold = 3, + SkSoftKeyTrnsfer = 4, + SkSoftKeyCFwdAll = 5, + SkSoftKeyCFwdBusy = 6, + SkSoftKeyCFwdNoAnswer = 7, + SkSoftKeyBackSpace = 8, + SkSoftKeyEndCall = 9, + SkSoftKeyResume = 10, + SkSoftKeyAnswer = 11, + SkSoftKeyInfo = 12, + SkSoftKeyConfrn = 13, + SkSoftKeyPark = 14, + SkSoftKeyJoin = 15, + SkSoftKeyMeetMeConfrn = 16, + SkSoftKeyCallPickUp = 17, + SkSoftKeyGrpCallPickUp = 18, + SkSoftKeyUnkn = 0 + } SoftKeyEventEnum; + + static int SoftKeyEventToEnum(CStdString& event); + static CStdString SoftKeyEventToString(int event); +}; + + +//=================================================================== /* * IAX2 Packet Headers */ diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index 2d32ee8..d30a29c 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -44,6 +44,7 @@ RtpSession::RtpSession(CStdString& trackingId) m_numRtpPackets = 0; m_started = false; m_stopped = false; + m_onHold = false; m_beginDate = 0; m_hasDuplicateRtp = false; m_highestRtpSeqNumDelta = 0; @@ -434,6 +435,13 @@ bool RtpSession::AddRtpPacket(RtpPacketInfoRef& rtpPacket) } } + // If we are on hold, unmark this + if(m_onHold) + { + logMsg = "[" + m_trackingId + "] Going off hold due to RTP activity"; + m_onHold = false; + } + if(m_lastRtpPacket.get() == NULL) { // Until now, we knew the remote IP and port for RTP (at best, as given by SIP invite or Skinny StartMediaTransmission) @@ -757,6 +765,14 @@ void RtpSessions::ReportSkinnyCallInfo(SkCallInfoStruct* callInfo, IpHeaderStruc return; // CM can resend the same message more than once in a session, so do nothing in this case } + /* For the case where we are simply going off hold, we need to check */ + RtpSessionRef sess; + sess = findByEndpointIpUsingIpAndPort(ipHeader->ip_dest); + if(sess.get()) + { + return; // We are simply going off hold + } + // create new session and insert into the callid map CStdString trackingId = m_alphaCounter.GetNext(); RtpSessionRef session(new RtpSession(trackingId)); @@ -800,6 +816,28 @@ void RtpSessions::ReportSkinnyCallInfo(SkCallInfoStruct* callInfo, IpHeaderStruc } +RtpSessionRef RtpSessions::findByEndpointIpUsingIpAndPort(struct in_addr endpointIpAddr) +{ + RtpSessionRef session; + std::map::iterator pair; + + // Scan all sessions and try to find a session on the same IP endpoint + // This function uses the m_byIpAndPort mapping unlike findByEndpointIp() + + for(pair = m_byIpAndPort.begin(); pair != m_byIpAndPort.end(); pair++) + { + RtpSessionRef tmpSession = pair->second; + + if((unsigned int)tmpSession->m_endPointIp.s_addr == (unsigned int)endpointIpAddr.s_addr) + { + session = tmpSession; + break; + } + } + + return session; +} + RtpSessionRef RtpSessions::findByEndpointIp(struct in_addr endpointIpAddr) { RtpSessionRef session; @@ -816,6 +854,7 @@ RtpSessionRef RtpSessions::findByEndpointIp(struct in_addr endpointIpAddr) break; } } + return session; } @@ -905,6 +944,17 @@ void RtpSessions::ReportSkinnyOpenReceiveChannelAck(SkOpenReceiveChannelAckStruc void RtpSessions::ReportSkinnyStartMediaTransmission(SkStartMediaTransmissionStruct* startMedia, IpHeaderStruct* ipHeader) { RtpSessionRef session = findByEndpointIp(ipHeader->ip_dest); + + if(!session.get()) + { + /* Could be due to disappearance of CallId mapping + * (See notes on Trac Ticket 168) */ + session = findByEndpointIpUsingIpAndPort(ipHeader->ip_dest); + if(session.get()) + { + session->m_ipAndPort = ""; + } + } if(session.get()) { if(session->m_ipAndPort.size() == 0) @@ -957,14 +1007,26 @@ void RtpSessions::ReportSkinnyStopMediaTransmission(SkStopMediaTransmissionStruc } if(session.get()) { - if(m_log->isInfoEnabled()) + if(session->m_onHold) { - CStdString logMsg; - logMsg.Format("[%s] Skinny StopMedia conferenceId:%s passThruPartyId:%s", session->m_trackingId, conferenceId, passThruPartyId); - LOG4CXX_INFO(m_log, logMsg); + if(m_log->isInfoEnabled()) + { + CStdString logMsg; + logMsg.Format("[%s] Ignoring Skinny StopMedia conferenceId:%s passThruPartyId:%s because we are on hold", session->m_trackingId, conferenceId, passThruPartyId); + LOG4CXX_INFO(m_log, logMsg); + } } + else + { + if(m_log->isInfoEnabled()) + { + CStdString logMsg; + logMsg.Format("[%s] Skinny StopMedia conferenceId:%s passThruPartyId:%s", session->m_trackingId, conferenceId, passThruPartyId); + LOG4CXX_INFO(m_log, logMsg); + } - Stop(session); + Stop(session); + } } } @@ -1001,6 +1063,54 @@ void RtpSessions::ReportSkinnyLineStat(SkLineStatStruct* lineStat, IpHeaderStruc } } +void RtpSessions::ReportSkinnySoftKeyHold(SkSoftKeyEventMessageStruct* skEvent, IpHeaderStruct* ipHeader) +{ + RtpSessionRef session; + CStdString logMsg; + + session = findByEndpointIpUsingIpAndPort(ipHeader->ip_src); + if(session.get()) + { + session->m_onHold = true; + logMsg.Format("[%s] Going on hold due to SoftKeyEvent: HOLD", session->m_trackingId); + LOG4CXX_INFO(m_log, logMsg); + } + else + { + char szEndpointIp[16]; + + ACE_OS::inet_ntop(AF_INET, (void*)&ipHeader->ip_src, szEndpointIp, sizeof(szEndpointIp)); + logMsg.Format("Received HOLD notification from endpoint %s but couldn't find any valid RTP Session", + szEndpointIp); + + LOG4CXX_WARN(m_log, logMsg); + } +} + +void RtpSessions::ReportSkinnySoftKeyResume(SkSoftKeyEventMessageStruct* skEvent, IpHeaderStruct* ipHeader) +{ + RtpSessionRef session; + CStdString logMsg; + + session = findByEndpointIpUsingIpAndPort(ipHeader->ip_src); + if(session.get()) + { + session->m_onHold = false; + logMsg.Format("[%s] Going off hold due to SoftKeyEvent: RESUME", session->m_trackingId); + LOG4CXX_INFO(m_log, logMsg); + } + else + { + char szEndpointIp[16]; + + ACE_OS::inet_ntop(AF_INET, (void*)&ipHeader->ip_src, szEndpointIp, sizeof(szEndpointIp)); + logMsg.Format("Received RESUME notification from endpoint %s but couldn't find any valid RTP Session", + szEndpointIp); + + LOG4CXX_WARN(m_log, logMsg); + } +} + EndpointInfoRef RtpSessions::GetEndpointInfo(struct in_addr endpointIp) { std::map::iterator pair; @@ -1235,7 +1345,11 @@ void RtpSessions::Hoover(time_t now) } else { - timeoutSeconds = DLLCONFIG.m_rtpSessionWithSignallingTimeoutSec; + if(session->m_onHold) { + timeoutSeconds = DLLCONFIG.m_rtpSessionOnHoldTimeOutSec; + } else { + timeoutSeconds = DLLCONFIG.m_rtpSessionWithSignallingTimeoutSec; + } } if((now - session->m_lastUpdated) > timeoutSeconds) { @@ -1256,9 +1370,17 @@ void RtpSessions::Hoover(time_t now) for(pair = m_byCallId.begin(); pair != m_byCallId.end(); pair++) { RtpSessionRef session = pair->second; - if((now - session->m_lastUpdated) > DLLCONFIG.m_rtpSessionWithSignallingTimeoutSec) - { - toDismiss.push_back(session); + + if(session->m_onHold) { + if((now - session->m_lastUpdated) > DLLCONFIG.m_rtpSessionOnHoldTimeOutSec) + { + toDismiss.push_back(session); + } + } else { + if((now - session->m_lastUpdated) > DLLCONFIG.m_rtpSessionWithSignallingTimeoutSec) + { + toDismiss.push_back(session); + } } } diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.h b/orkaudio/audiocaptureplugins/voip/RtpSession.h index 6c66e85..70c0f4b 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.h +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.h @@ -88,6 +88,8 @@ public: int m_numRtpPackets; struct in_addr m_endPointIp; // only used for Skinny + bool m_onHold; + private: void ProcessMetadataSip(RtpPacketInfoRef&); void ProcessMetadataSipIncoming(); @@ -140,11 +142,14 @@ public: void ReportSkinnyStopMediaTransmission(SkStopMediaTransmissionStruct*, IpHeaderStruct* ipHeader); void ReportSkinnyOpenReceiveChannelAck(SkOpenReceiveChannelAckStruct*); void ReportSkinnyLineStat(SkLineStatStruct*, IpHeaderStruct* ipHeader); + void ReportSkinnySoftKeyHold(SkSoftKeyEventMessageStruct* skEvent, IpHeaderStruct* ipHeader); + void ReportSkinnySoftKeyResume(SkSoftKeyEventMessageStruct* skEvent, IpHeaderStruct* ipHeader); void ReportRtpPacket(RtpPacketInfoRef& rtpPacket); void Hoover(time_t now); EndpointInfoRef GetEndpointInfo(struct in_addr endpointIp); private: RtpSessionRef findByEndpointIp(struct in_addr); + RtpSessionRef findByEndpointIpUsingIpAndPort(struct in_addr endpointIpAddr); void ChangeCallId(RtpSessionRef& session, unsigned int newId); void SetMediaAddress(RtpSessionRef& session, struct in_addr mediaIp, unsigned short mediaPort); CStdString GenerateSkinnyCallId(struct in_addr endpointIp, unsigned int callId); diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 1c9cddb..c008bfc 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -1377,6 +1377,7 @@ void HandleSkinnyMessage(SkinnyHeaderStruct* skinnyHeader, IpHeaderStruct* ipHea SkOpenReceiveChannelAckStruct* openReceiveAck; SkLineStatStruct* lineStat; SkCcm5CallInfoStruct* ccm5CallInfo; + SkSoftKeyEventMessageStruct* softKeyEvent; char szEndpointIp[16]; struct in_addr endpointIp = ipHeader->ip_dest; // most of the interesting skinny messages are CCM -> phone @@ -1490,6 +1491,43 @@ void HandleSkinnyMessage(SkinnyHeaderStruct* skinnyHeader, IpHeaderStruct* ipHea LOG4CXX_WARN(s_skinnyPacketLog, "Invalid LineStatMessage."); } + break; + case SkSoftKeyEventMessage: + softKeyEvent = (SkSoftKeyEventMessageStruct*)skinnyHeader; + if(SkinnyValidateSoftKeyEvent(softKeyEvent)) + { + useful = true; + logMsg.Format(" eventString:%s eventNumber:%d line_instance:%lu call_identifier:%lu", + SoftKeyEvent::SoftKeyEventToString(softKeyEvent->soft_key_event), + softKeyEvent->soft_key_event, + softKeyEvent->line_instance, + softKeyEvent->call_identifier); + + endpointIp = ipHeader->ip_src; // this skinny message is phone -> CCM + + switch(softKeyEvent->soft_key_event) + { + case SoftKeyEvent::SkSoftKeyHold: + RtpSessionsSingleton::instance()->ReportSkinnySoftKeyHold(softKeyEvent, ipHeader); + break; + case SoftKeyEvent::SkSoftKeyResume: + RtpSessionsSingleton::instance()->ReportSkinnySoftKeyResume(softKeyEvent, ipHeader); + break; + default: + CStdString logSoftKey; + + logSoftKey.Format("Ignoring unsupported event %s (%d)", + SoftKeyEvent::SoftKeyEventToString(softKeyEvent->soft_key_event), + softKeyEvent->soft_key_event); + LOG4CXX_INFO(s_skinnyPacketLog, logSoftKey); + break; + } + } + else + { + useful = false; + LOG4CXX_WARN(s_skinnyPacketLog, "Invalid SoftKeyEventMessage."); + } break; default: useful = false; diff --git a/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp b/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp index 2ff4046..c924bd8 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp @@ -32,6 +32,7 @@ VoIpConfig::VoIpConfig() m_pcapFastReplaySleepUsPerSec = 0; m_rtpSessionTimeoutSec = 10; m_rtpSessionWithSignallingTimeoutSec = 5*60; + m_rtpSessionOnHoldTimeOutSec = 1800; m_pcapTest= false; m_rtpDiscontinuityDetect = false; m_rtpDiscontinuityMinSeqDelta = 1000; @@ -60,6 +61,7 @@ void VoIpConfig::Define(Serializer* s) s->IntValue("PcapSocketBufferSize", m_pcapSocketBufferSize); s->IntValue("RtpSessionTimeoutSec", m_rtpSessionTimeoutSec); s->IntValue("RtpSessionWithSignallingTimeoutSec", m_rtpSessionWithSignallingTimeoutSec); + s->IntValue("RtpSessionOnHoldTimeOutSec", m_rtpSessionOnHoldTimeOutSec); s->BoolValue("PcapTest", m_pcapTest); s->BoolValue("RtpDiscontinuityDetect", m_rtpDiscontinuityDetect); s->IntValue("RtpDiscontinuityMinSeqDelta", m_rtpDiscontinuityMinSeqDelta); @@ -229,6 +231,12 @@ void VoIpConfig::Validate() exception.Format("VoIpConfig: RtpSessionWithSignallingTimeoutSec must be > 0 (currently:%d) please fix config.xml", m_rtpSessionWithSignallingTimeoutSec); throw (exception); } + if(m_rtpSessionOnHoldTimeOutSec < 1) + { + CStdString exception; + exception.Format("VoIpConfig: RtpSessionOnHoldTimeOutSec must be > 0 (currently:%d) please fix config.xml", m_rtpSessionWithSignallingTimeoutSec); + throw (exception); + } } bool VoIpConfig::IsPartOfLan(struct in_addr addr) diff --git a/orkaudio/audiocaptureplugins/voip/VoIpConfig.h b/orkaudio/audiocaptureplugins/voip/VoIpConfig.h index 2e62f39..ccc9a9e 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIpConfig.h +++ b/orkaudio/audiocaptureplugins/voip/VoIpConfig.h @@ -65,6 +65,7 @@ public: int m_pcapFastReplaySleepUsPerSec; int m_rtpSessionTimeoutSec; int m_rtpSessionWithSignallingTimeoutSec; + int m_rtpSessionOnHoldTimeOutSec; bool m_pcapTest; bool m_rtpDiscontinuityDetect; int m_rtpDiscontinuityMinSeqDelta; -- cgit v1.2.3