Skip to content

Commit

Permalink
[mid_registrar] Fixes expires parameter when it must be 0.
Browse files Browse the repository at this point in the history
Fixes #2722

(cherry picked from commit 5d50923)
  • Loading branch information
vasilevalex authored and liviuchircu committed Jan 10, 2022
1 parent 1342414 commit 2dfacce
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions modules/mid_registrar/save.c
Expand Up @@ -539,10 +539,7 @@ void overwrite_contact_expirations(struct sip_msg *req, struct mid_reg_info *mri
for (c = get_first_contact(req); c; c = get_next_contact(c)) {
calc_contact_expires(req, c->expires, &e, 1);
calc_ob_contact_expires(req, c->expires, &expiry_tick, mri->expires_out);
if (expiry_tick == 0)
new_expires = 0;
else
new_expires = expiry_tick - get_act_time();
new_expires = expiry_tick == 0 ? 0 : expiry_tick - get_act_time();

LM_DBG("....... contact: '%.*s' Calculated TIMEOUT = %d (%d)\n",
c->len, c->uri.s, expiry_tick, new_expires);
Expand Down Expand Up @@ -1348,7 +1345,7 @@ static inline int save_restore_rpl_contacts(struct sip_msg *req,
goto update_usrloc;

calc_ob_contact_expires(rpl, _c->expires, &e_out, 0);
e_out -= get_act_time();
e_out = e_out == 0 ? 0 : e_out - get_act_time();

/* the main registrar might enforce shorter lifetimes */
if (e_out < ctmap->expires)
Expand Down

0 comments on commit 2dfacce

Please sign in to comment.