Skip to content

Commit

Permalink
Merge pull request #698 from sjthomason/sipcapture-timestamp-fix
Browse files Browse the repository at this point in the history
Sipcapture timestamp fix
  • Loading branch information
adubovikov committed Jul 7, 2016
2 parents f32e12b + 0eac280 commit adfce11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/sipcapture/hep.c
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
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
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

0 comments on commit adfce11

Please sign in to comment.