Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sipcapture timestamp fix #698

Merged
merged 2 commits into from
Jul 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/sipcapture/hep.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ int hepv2_received(char *buf, unsigned int len, struct receive_info *ri){
hep_offset+=sizeof(struct hep_timehdr);
heptime_tmp = (struct hep_timehdr*) hep_payload;

heptime->tv_sec = heptime_tmp->tv_sec;
heptime->tv_usec = heptime_tmp->tv_usec;
heptime->tv_sec = to_le(heptime_tmp->tv_sec);
heptime->tv_usec = to_le(heptime_tmp->tv_usec);
heptime->captid = heptime_tmp->captid;
}

Expand Down
7 changes: 7 additions & 0 deletions modules/sipcapture/hep.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
#ifndef _hep_h
#define _hep_h

#include "../../endianness.h"

#ifdef __IS_BIG_ENDIAN
#define to_le(x) bswap32(x)
#else
#define to_le(x) (x)
#endif

#ifdef __OS_solaris
typedef uint8_t u_int8_t;
Expand Down
4 changes: 2 additions & 2 deletions modules/siptrace/siptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,8 +1799,8 @@ static int trace_send_hep_duplicate(str *body, str *from, str *to, struct dest_i

if(hep_version == 2) {

hep_time.tv_sec = tvb.tv_sec;
hep_time.tv_usec = tvb.tv_usec;
hep_time.tv_sec = to_le(tvb.tv_sec);
hep_time.tv_usec = to_le(tvb.tv_usec);
hep_time.captid = hep_capture_id;

memcpy((void*)buffer+buflen, &hep_time, sizeof(struct hep_timehdr));
Expand Down