Module: kamailio Branch: master Commit: c2e404b82f20a12b5909bbf610cbfb7f5d101c12 URL: https://github.com/kamailio/kamailio/commit/c2e404b82f20a12b5909bbf610cbfb7f...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2016-03-18T14:58:27+01:00
topos: store method and cseq for dialogs and branches
---
Modified: modules/topos/tps_storage.c Modified: modules/topos/tps_storage.h
---
Diff: https://github.com/kamailio/kamailio/commit/c2e404b82f20a12b5909bbf610cbfb7f... Patch: https://github.com/kamailio/kamailio/commit/c2e404b82f20a12b5909bbf610cbfb7f...
---
diff --git a/modules/topos/tps_storage.c b/modules/topos/tps_storage.c index 1eb6fca..d6dbabc 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 ce36273..0fca469 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);