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

usrloc: Incorrect date format used to query contacts by expire time. #1514

Closed
Closed
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
11 changes: 1 addition & 10 deletions src/modules/usrloc/dlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ static inline int get_all_db_ucontacts(void *buf, int len, unsigned int flags,
db1_res_t* res = NULL;
db_row_t *row;
dlist_t *dom;
str now;
char now_s[25];
int port, proto;
char *p;
str addr;
Expand All @@ -121,13 +119,6 @@ static inline int get_all_db_ucontacts(void *buf, int len, unsigned int flags,
/* Reserve space for terminating 0000 */
len -= sizeof(addr.len);

/* get the current time in DB format */
now.len = 25;
now.s = now_s;
if (db_time2str_ex( time(0), now.s, &now.len, 0)!=0) {
LM_ERR("failed to print now time\n");
return -1;
}
aorhash = 0;

/* select fields */
Expand All @@ -143,7 +134,7 @@ static inline int get_all_db_ucontacts(void *buf, int len, unsigned int flags,
ops1[0] = OP_GT;
vals1[0].type = DB1_STR;
vals1[0].nul = 0;
vals1[0].val.str_val = now;
UL_DB_EXPIRES_SET(&vals1[0], time(0));

keys1[1] = &partition_col;
ops1[1] = OP_EQ;
Expand Down