From c2e404b82f20a12b5909bbf610cbfb7f5d101c12 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 18 Mar 2016 14:58:27 +0100 Subject: [PATCH] topos: store method and cseq for dialogs and branches --- modules/topos/tps_storage.c | 24 ++++++++++++++++++++++++ modules/topos/tps_storage.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/modules/topos/tps_storage.c b/modules/topos/tps_storage.c index 1eb6fca9cb7..d6dbabcc13d 100644 --- a/modules/topos/tps_storage.c +++ b/modules/topos/tps_storage.c @@ -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"); @@ -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 @@ -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; @@ -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; diff --git a/modules/topos/tps_storage.h b/modules/topos/tps_storage.h index ce36273a199..0fca4690ff0 100644 --- a/modules/topos/tps_storage.h +++ b/modules/topos/tps_storage.h @@ -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);