Skip to content

Commit

Permalink
topos: store method and cseq for dialogs and branches
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Mar 18, 2016
1 parent c8d25c3 commit c2e404b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions modules/topos/tps_storage.c
Expand Up @@ -346,6 +346,8 @@ str td_col_b_uri = str_init("b_uri");
str td_col_r_uri = str_init("r_uri");
str td_col_a_srcip = str_init("a_srcip");
str td_col_b_srcip = str_init("b_srcip");
str td_col_s_method = str_init("s_method");
str td_col_s_cseq = str_init("s_cseq");

str tt_table_name = str_init("topos_t");
str tt_col_rectime = str_init("rectime");
Expand All @@ -358,6 +360,8 @@ str tt_col_x_vbranch = str_init("x_vbranch");
str tt_col_x_rr = str_init("x_rr");
str tt_col_x_uri = str_init("x_uri");
str tt_col_x_tag = str_init("x_tag");
str tt_col_s_method = str_init("s_method");
str tt_col_s_cseq = str_init("s_cseq");

#define TPS_NR_KEYS 32

Expand Down Expand Up @@ -467,6 +471,16 @@ int tps_db_insert_dialog(tps_data_t *td)
db_vals[nr_keys].val.str_val = TPS_STRZ(td->b_srcip);
nr_keys++;

db_keys[nr_keys] = &td_col_s_method;
db_vals[nr_keys].type = DB1_STR;
db_vals[nr_keys].val.str_val = TPS_STRZ(td->s_method);
nr_keys++;

db_keys[nr_keys] = &td_col_s_cseq;
db_vals[nr_keys].type = DB1_INT;
db_vals[nr_keys].val.int_val = (int)td->s_cseq;
nr_keys++;

if (_tpsdbf.use_table(_tps_db_handle, &td_table_name) < 0) {
LM_ERR("failed to perform use table\n");
return -1;
Expand Down Expand Up @@ -577,6 +591,16 @@ int tps_db_insert_branch(tps_data_t *td)
db_vals[nr_keys].val.str_val = TPS_STRZ(td->x_tag);
nr_keys++;

db_keys[nr_keys] = &tt_col_s_method;
db_vals[nr_keys].type = DB1_STR;
db_vals[nr_keys].val.str_val = TPS_STRZ(td->s_method);
nr_keys++;

db_keys[nr_keys] = &tt_col_s_cseq;
db_vals[nr_keys].type = DB1_INT;
db_vals[nr_keys].val.int_val = (int)td->s_cseq;
nr_keys++;

if (_tpsdbf.use_table(_tps_db_handle, &tt_table_name) < 0) {
LM_ERR("failed to perform use table\n");
return -1;
Expand Down
2 changes: 2 additions & 0 deletions modules/topos/tps_storage.h
Expand Up @@ -61,8 +61,10 @@ typedef struct tps_data {
str x_tag;
str x_rr;
str x_uri;
str s_method;
int32_t iflags;
int32_t direction;
int32_t s_cseq;
} tps_data_t;

int tps_storage_dialog_find(sip_msg_t *msg, tps_data_t *td);
Expand Down

0 comments on commit c2e404b

Please sign in to comment.