Skip to content

Commit

Permalink
usrloc: Add expires value to contact struct
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Dec 5, 2016
1 parent 5117e36 commit ca8b61f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions modules/usrloc/ucontact.c
Expand Up @@ -49,6 +49,7 @@
#include "ureplication.h"
#include "udomain.h"
#include "dlist.h"
#include "utime.h"

extern event_id_t ei_c_update_id;

Expand Down Expand Up @@ -136,9 +137,12 @@ new_ucontact(str* _dom, str* _aor, str* _contact, ucontact_info_t* _ci)
if (shm_str_dup( &c->attr, _ci->attr) < 0) goto mem_error;
}

get_act_time();

c->domain = _dom;
c->aor = _aor;
c->expires = _ci->expires;
c->expires_sip = _ci->expires - act_time;
c->q = _ci->q;
c->sock = _ci->sock;
c->cseq = _ci->cseq;
Expand Down Expand Up @@ -306,8 +310,11 @@ int mem_update_ucontact(ucontact_t* _c, ucontact_info_t* _ci)
_c->attr.len = 0;
}

get_act_time();

_c->sock = _ci->sock;
_c->expires = _ci->expires;
_c->expires_sip = _ci->expires - act_time;
_c->q = _ci->q;
_c->cseq = _ci->cseq;
_c->methods = _ci->methods;
Expand Down
3 changes: 2 additions & 1 deletion modules/usrloc/ucontact.h
Expand Up @@ -78,7 +78,8 @@ typedef struct ucontact {
str c; /*!< Contact address */
str received; /*!< IP+port+protocol we received the REGISTER from */
str path; /*!< Path header */
time_t expires; /*!< Expires parameter */
time_t expires; /*!< UNIX timestamp for the expiry */
time_t expires_sip; /*!< Expires parameter */
qvalue_t q; /*!< q parameter */
str instance; /*!< instance parameter */
str callid; /*!< Call-ID header field of registration */
Expand Down

0 comments on commit ca8b61f

Please sign in to comment.