From 78efb87ddd8c0cb0c82fe03d43cf26ac0971d15b Mon Sep 17 00:00:00 2001 From: Gerald Begumisa Date: Fri, 15 May 2009 15:45:30 +0000 Subject: Added support for setting the SIP request URI as local party. If the SIP request URI differs from the SIP URI in the "To:" header field, then the local party is set to the SIP request URI, remote party to the "From:" header field, direction to "in", Local entry point to the "To:" header field. This behaviour may be turned off by setting the configuration parameter SipRequestUriAsLocalParty to "false" under the VoIpPlugin section of config.xml. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@611 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/VoIp.cpp | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'orkaudio/audiocaptureplugins/voip/VoIp.cpp') diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index f9c5fb6..0d5c8aa 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -2081,6 +2081,52 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader char* attribSendonly = memFindAfter("a=sendonly", (char*)udpPayload, sipEnd); char* rtpmapAttribute = memFindAfter("\na=rtpmap:", (char*)udpPayload, sipEnd); + if(DLLCONFIG.m_sipRequestUriAsLocalParty == true) + { + char* sipUriAttribute = memFindAfter("INVITE ", (char*)udpPayload, sipEnd); + + if(sipUriAttribute) + { + if(s_sipExtractionLog->isDebugEnabled()) + { + CStdString uri; + GrabLine(sipUriAttribute, sipEnd, uri); + LOG4CXX_DEBUG(s_sipExtractionLog, "uri: " + uri); + } + + char* sipUriAttributeEnd = memFindEOL(sipUriAttribute, sipEnd); + char* sipUser = memFindAfter("sip:", sipUriAttribute, sipUriAttributeEnd); + + if(sipUser) + { + if(DLLCONFIG.m_sipReportFullAddress) + { + GrabSipUserAddress(sipUser, sipUriAttributeEnd, info->m_requestUri); + } + else + { + GrabSipUriUser(sipUser, sipUriAttributeEnd, info->m_requestUri); + } + } + else + { + if(DLLCONFIG.m_sipReportFullAddress) + { + GrabSipUserAddress(sipUriAttribute, sipUriAttributeEnd, info->m_requestUri); + } + else + { + GrabSipUriUser(sipUriAttribute, sipUriAttributeEnd, info->m_requestUri); + } + } + + if(s_sipExtractionLog->isDebugEnabled()) + { + LOG4CXX_DEBUG(s_sipExtractionLog, "extracted uri: " + info->m_requestUri); + } + } + } + if(fromField) { if(s_sipExtractionLog->isDebugEnabled()) -- cgit v1.2.3