diff options
author | Gerald Begumisa <ben_g@users.sourceforge.net> | 2009-07-31 14:12:24 +0000 |
---|---|---|
committer | Gerald Begumisa <ben_g@users.sourceforge.net> | 2009-07-31 14:12:24 +0000 |
commit | 1cf0cfc8155b0376d35017c4167bece5742fa6af (patch) | |
tree | 43c98b28f6910e6f016e36fe49b80aaf716537b9 /orkaudio/audiocaptureplugins/voip/VoIp.cpp | |
parent | 4807fe2c6198b39aff5c1ff1144c465b97575cb8 (diff) |
Added new configuration parameter, Cucm7-1Mode, which if set to "true" in the VoIpPlugin section of config.xml, shall activate special parsing of the StartMediaTransmission, OpenReceiveChannelAck and CallInfo messages, which is specific to Cisco Unified Call Manager v7.1.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@632 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/audiocaptureplugins/voip/VoIp.cpp')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIp.cpp | 129 |
1 files changed, 107 insertions, 22 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 2ca681c..6640590 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -2385,9 +2385,11 @@ void HandleSkinnyMessage(SkinnyHeaderStruct* skinnyHeader, IpHeaderStruct* ipHea CStdString logMsg; SkStartMediaTransmissionStruct* startMedia; + SkStartMediaTransmissionStruct smtmp; SkStopMediaTransmissionStruct* stopMedia; SkCallInfoStruct* callInfo; SkOpenReceiveChannelAckStruct* openReceiveAck; + SkOpenReceiveChannelAckStruct orcatmp; SkLineStatStruct* lineStat; SkCcm5CallInfoStruct* ccm5CallInfo; SkSoftKeyEventMessageStruct* softKeyEvent; @@ -2395,24 +2397,61 @@ void HandleSkinnyMessage(SkinnyHeaderStruct* skinnyHeader, IpHeaderStruct* ipHea char szEndpointIp[16]; struct in_addr endpointIp = ipHeader->ip_dest; // most of the interesting skinny messages are CCM -> phone + memset(&smtmp, 0, sizeof(smtmp)); + memset(&orcatmp, 0, sizeof(orcatmp)); + switch(skinnyHeader->messageType) { case SkStartMediaTransmission: - startMedia = (SkStartMediaTransmissionStruct*)skinnyHeader; - if(SkinnyValidateStartMediaTransmission(startMedia, packetEnd)) + if(DLLCONFIG.m_cucm7_1Mode == true) { - if(s_skinnyPacketLog->isInfoEnabled()) + SkCcm7_1StartMediaTransmissionStruct *ccm7_1sm; + + ccm7_1sm = (SkCcm7_1StartMediaTransmissionStruct*)skinnyHeader; + if(SkinnyValidateCcm7_1StartMediaTransmission(ccm7_1sm, packetEnd)) + { + startMedia = &smtmp; + + memcpy(&startMedia->header, &ccm7_1sm->header, sizeof(startMedia->header)); + startMedia->conferenceId = ccm7_1sm->conferenceId; + startMedia->passThruPartyId = ccm7_1sm->passThruPartyId; + memcpy(&startMedia->remoteIpAddr, &ccm7_1sm->remoteIpAddr, sizeof(startMedia->remoteIpAddr)); + startMedia->remoteTcpPort = ccm7_1sm->remoteTcpPort; + + if(s_skinnyPacketLog->isInfoEnabled()) + { + char szRemoteIp[16]; + ACE_OS::inet_ntop(AF_INET, (void*)&startMedia->remoteIpAddr, szRemoteIp, sizeof(szRemoteIp)); + logMsg.Format(" (CCM 7.1) CallId:%u PassThru:%u media address:%s,%u", startMedia->conferenceId, startMedia->passThruPartyId, szRemoteIp, startMedia->remoteTcpPort); + } + + RtpSessionsSingleton::instance()->ReportSkinnyStartMediaTransmission(startMedia, ipHeader); + } + else { - char szRemoteIp[16]; - ACE_OS::inet_ntop(AF_INET, (void*)&startMedia->remoteIpAddr, szRemoteIp, sizeof(szRemoteIp)); - logMsg.Format(" CallId:%u PassThru:%u media address:%s,%u", startMedia->conferenceId, startMedia->passThruPartyId, szRemoteIp, startMedia->remoteTcpPort); + useful = false; + LOG4CXX_WARN(s_skinnyPacketLog, "Invalid CCM 7.1 StartMediaTransmission."); } - RtpSessionsSingleton::instance()->ReportSkinnyStartMediaTransmission(startMedia, ipHeader); } else { - useful = false; - LOG4CXX_WARN(s_skinnyPacketLog, "Invalid StartMediaTransmission."); + startMedia = (SkStartMediaTransmissionStruct*)skinnyHeader; + + if(SkinnyValidateStartMediaTransmission(startMedia, packetEnd)) + { + if(s_skinnyPacketLog->isInfoEnabled()) + { + char szRemoteIp[16]; + ACE_OS::inet_ntop(AF_INET, (void*)&startMedia->remoteIpAddr, szRemoteIp, sizeof(szRemoteIp)); + logMsg.Format(" CallId:%u PassThru:%u media address:%s,%u", startMedia->conferenceId, startMedia->passThruPartyId, szRemoteIp, startMedia->remoteTcpPort); + } + RtpSessionsSingleton::instance()->ReportSkinnyStartMediaTransmission(startMedia, ipHeader); + } + else + { + useful = false; + LOG4CXX_WARN(s_skinnyPacketLog, "Invalid StartMediaTransmission."); + } } break; case SkStopMediaTransmission: @@ -2494,11 +2533,23 @@ void HandleSkinnyMessage(SkinnyHeaderStruct* skinnyHeader, IpHeaderStruct* ipHea case 2: calledParty = party; break; + case 3: + if(DLLCONFIG.m_cucm7_1Mode == true) + { + // In CCM 7.1, it appears that each party is + // named twice + calledParty = party; + } + break; case 5: - // Token 5 is the calling extension, use this if outbound for callingParty instead of general number - if(party.size()>0 && ccm5CallInfo->callType == SKINNY_CALL_TYPE_OUTBOUND) + if(DLLCONFIG.m_cucm7_1Mode == false) { - callingParty = party; + // Token 5 is the calling extension, use this if outbound for callingParty instead of general number + // With CCM 7.1, this appears not to be the case + if(party.size()>0 && ccm5CallInfo->callType == SKINNY_CALL_TYPE_OUTBOUND) + { + callingParty = party; + } } break; case 6: @@ -2547,22 +2598,56 @@ void HandleSkinnyMessage(SkinnyHeaderStruct* skinnyHeader, IpHeaderStruct* ipHea } break; case SkOpenReceiveChannelAck: - openReceiveAck = (SkOpenReceiveChannelAckStruct*)skinnyHeader; - if(SkinnyValidateOpenReceiveChannelAck(openReceiveAck, packetEnd)) + if(DLLCONFIG.m_cucm7_1Mode == true) { - if(s_skinnyPacketLog->isInfoEnabled()) + SkCcm7_1SkOpenReceiveChannelAckStruct *orca; + + orca = (SkCcm7_1SkOpenReceiveChannelAckStruct*)skinnyHeader; + if(SkinnyValidateCcm7_1SkOpenReceiveChannelAckStruct(orca, packetEnd)) { - char szMediaIp[16]; - ACE_OS::inet_ntop(AF_INET, (void*)&openReceiveAck->endpointIpAddr, szMediaIp, sizeof(szMediaIp)); - logMsg.Format(" PassThru:%u media address:%s,%u", openReceiveAck->passThruPartyId, szMediaIp, openReceiveAck->endpointTcpPort); + openReceiveAck = &orcatmp; + + memcpy(&openReceiveAck->header, &orca->header, sizeof(openReceiveAck->header)); + openReceiveAck->openReceiveChannelStatus = orca->openReceiveChannelStatus; + memcpy(&openReceiveAck->endpointIpAddr, &orca->endpointIpAddr, sizeof(openReceiveAck->endpointIpAddr)); + openReceiveAck->endpointTcpPort = orca->endpointTcpPort; + openReceiveAck->passThruPartyId = orca->passThruPartyId; + + if(s_skinnyPacketLog->isInfoEnabled()) + { + char szMediaIp[16]; + ACE_OS::inet_ntop(AF_INET, (void*)&openReceiveAck->endpointIpAddr, szMediaIp, sizeof(szMediaIp)); + logMsg.Format(" (CCM 7.1) PassThru:%u media address:%s,%u", openReceiveAck->passThruPartyId, szMediaIp, openReceiveAck->endpointTcpPort); + } + endpointIp = ipHeader->ip_src; // this skinny message is phone -> CCM + RtpSessionsSingleton::instance()->ReportSkinnyOpenReceiveChannelAck(openReceiveAck); + } + else + { + useful = false; + LOG4CXX_WARN(s_skinnyPacketLog, "Invalid CCM 7.1 OpenReceiveChannelAck."); } - endpointIp = ipHeader->ip_src; // this skinny message is phone -> CCM - RtpSessionsSingleton::instance()->ReportSkinnyOpenReceiveChannelAck(openReceiveAck); } else { - useful = false; - LOG4CXX_WARN(s_skinnyPacketLog, "Invalid OpenReceiveChannelAck."); + openReceiveAck = (SkOpenReceiveChannelAckStruct*)skinnyHeader; + + if(SkinnyValidateOpenReceiveChannelAck(openReceiveAck, packetEnd)) + { + if(s_skinnyPacketLog->isInfoEnabled()) + { + char szMediaIp[16]; + ACE_OS::inet_ntop(AF_INET, (void*)&openReceiveAck->endpointIpAddr, szMediaIp, sizeof(szMediaIp)); + logMsg.Format(" PassThru:%u media address:%s,%u", openReceiveAck->passThruPartyId, szMediaIp, openReceiveAck->endpointTcpPort); + } + endpointIp = ipHeader->ip_src; // this skinny message is phone -> CCM + RtpSessionsSingleton::instance()->ReportSkinnyOpenReceiveChannelAck(openReceiveAck); + } + else + { + useful = false; + LOG4CXX_WARN(s_skinnyPacketLog, "Invalid OpenReceiveChannelAck."); + } } break; case SkLineStatMessage: |