From 747f19b5e2f1777639398d42a05812834d2c648f Mon Sep 17 00:00:00 2001 From: beg_g Date: Mon, 19 Oct 2009 14:55:46 +0000 Subject: Added support for the SIP response "302 Moved Temporarily". The way this works is that the "Contact" header is mapped to the "To" header such that a subsequent INVITE based on the "302 Moved Temporarily" response shall have the correct remote party parameter. This functionality is by default enabled and can be disabled by setting the parameter Sip302MovedTemporarilySupport to 'false'. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@647 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h') diff --git a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h index fbc547e..5ea6f45 100644 --- a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h +++ b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h @@ -391,12 +391,14 @@ struct Iax2MetaTrunkEntryTs { #define SIP_METHOD_BYE_SIZE 3 #define SIP_RESPONSE_200_OK_SIZE 11 #define SIP_RESPONSE_SESSION_PROGRESS_SIZE 28 +#define SIP_RESPONSE_302_MOVED_TEMPORARILY_SIZE 29 #define SIP_METHOD_INVITE "INVITE" #define SIP_METHOD_ACK "ACK" #define SIP_METHOD_BYE "BYE" #define SIP_METHOD_200_OK "200 OK" #define SIP_RESPONSE_200_OK "SIP/2.0 200" #define SIP_RESPONSE_SESSION_PROGRESS "SIP/2.0 183 Session Progress" +#define SIP_RESPONSE_302_MOVED_TEMPORARILY "SIP/2.0 302 Moved Temporarily" #endif -- cgit v1.2.3 From e727d533a411c5625d6c1361f3b5ee4bb514cb89 Mon Sep 17 00:00:00 2001 From: beg_g Date: Fri, 27 Nov 2009 19:15:20 +0000 Subject: Added support for captured packets of with 802.1Q Virtual LAN headers git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@658 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h | 2 +- orkaudio/audiocaptureplugins/voip/VoIp.cpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h') diff --git a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h index 5ea6f45..cf88d90 100644 --- a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h +++ b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h @@ -26,7 +26,7 @@ typedef struct { unsigned char destinationMac[6]; unsigned char sourceMac[6]; - unsigned short length; + unsigned short type; } EthernetHeaderStruct; diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 55a5443..2ee0b95 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -3046,7 +3046,17 @@ void HandlePacket(u_char *param, const struct pcap_pkthdr *header, const u_char } EthernetHeaderStruct* ethernetHeader = (EthernetHeaderStruct *)pkt_data; - IpHeaderStruct* ipHeader = (IpHeaderStruct*)((char*)ethernetHeader + sizeof(EthernetHeaderStruct)); + IpHeaderStruct* ipHeader = NULL; + + if(ntohs(ethernetHeader->type) == 0x8100) + { + ipHeader = (IpHeaderStruct*)((char*)ethernetHeader + sizeof(EthernetHeaderStruct) + 4); + } + else + { + ipHeader = (IpHeaderStruct*)((char*)ethernetHeader + sizeof(EthernetHeaderStruct)); + } + if(ipHeader->ip_v != 4) // sanity check, is it an IP packet v4 { // If not, the IP packet might have been captured from multiple interfaces using the tcpdump -i switch -- cgit v1.2.3