Browse code

topos_redis: store context field

Daniel-Constantin Mierla authored on 03/05/2021 05:59:54
Showing 1 changed files
... ...
@@ -78,6 +78,7 @@ str td_key_a_srcaddr = str_init("a_srcaddr");
78 78
 str td_key_b_srcaddr = str_init("b_srcaddr");
79 79
 str td_key_s_method = str_init("s_method");
80 80
 str td_key_s_cseq = str_init("s_cseq");
81
+str td_key_x_context = str_init("x_context");
81 82
 
82 83
 str tt_key_rectime = str_init("rectime");
83 84
 str tt_key_a_callid = str_init("a_callid");
... ...
@@ -99,6 +100,7 @@ str tt_key_a_tag = str_init("a_tag");
99 100
 str tt_key_b_tag = str_init("b_tag");
100 101
 str tt_key_s_method = str_init("s_method");
101 102
 str tt_key_s_cseq = str_init("s_cseq");
103
+str tt_key_x_context = str_init("x_context");
102 104
 
103 105
 #define TPS_REDIS_SET_ARGSV(sval, argc, argv, argvlen) \
104 106
 	do { \
... ...
@@ -242,6 +244,8 @@ int tps_redis_insert_dialog(tps_data_t *td)
242 244
 	TPS_REDIS_SET_ARGS(&td->s_method, argc, &td_key_s_method, argv, argvlen);
243 245
 	TPS_REDIS_SET_ARGS(&td->s_cseq, argc, &td_key_s_cseq, argv, argvlen);
244 246
 
247
+	TPS_REDIS_SET_ARGS(&td->x_context, argc, &td_key_x_context, argv, argvlen);
248
+
245 249
 	rrpl = _tps_redis_api.exec_argv(rsrv, argc, (const char **)argv, argvlen);
246 250
 	if(rrpl==NULL) {
247 251
 		LM_ERR("failed to execute redis command\n");
... ...
@@ -502,6 +506,8 @@ int tps_redis_insert_branch(tps_data_t *td)
502 506
 	TPS_REDIS_SET_ARGS(&td->a_tag, argc, &tt_key_a_tag, argv, argvlen);
503 507
 	TPS_REDIS_SET_ARGS(&td->b_tag, argc, &tt_key_b_tag, argv, argvlen);
504 508
 
509
+	TPS_REDIS_SET_ARGS(&td->x_context, argc, &tt_key_x_context, argv, argvlen);
510
+
505 511
 	rrpl = _tps_redis_api.exec_argv(rsrv, argc, (const char **)argv, argvlen);
506 512
 	if(rrpl==NULL) {
507 513
 		LM_ERR("failed to execute redis command\n");
... ...
@@ -929,6 +935,9 @@ int tps_redis_load_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd,
929 935
 		} else if(skey.len==tt_key_b_tag.len
930 936
 				&& strncmp(skey.s, tt_key_b_tag.s, skey.len)==0) {
931 937
 			TPS_REDIS_DATA_APPEND(sd, &skey, &sval, &sd->b_tag);
938
+		} else if(skey.len==tt_key_x_context.len
939
+				&& strncmp(skey.s, tt_key_x_context.s, skey.len)==0) {
940
+			TPS_REDIS_DATA_APPEND(sd, &skey, &sval, &sd->x_context);
932 941
 		} else {
933 942
 			LM_WARN("unknown key[%.*s]\n", skey.len, skey.s);
934 943
 		}
... ...
@@ -1134,6 +1143,9 @@ int tps_redis_load_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd)
1134 1143
 		} else if(skey.len==td_key_s_cseq.len
1135 1144
 				&& strncmp(skey.s, td_key_s_cseq.s, skey.len)==0) {
1136 1145
 			TPS_REDIS_DATA_APPEND(sd, &skey, &sval, &sd->s_cseq);
1146
+		} else if(skey.len==td_key_x_context.len
1147
+				&& strncmp(skey.s, td_key_x_context.s, skey.len)==0) {
1148
+			TPS_REDIS_DATA_APPEND(sd, &skey, &sval, &sd->x_context);
1137 1149
 		} else {
1138 1150
 			LM_WARN("unknown key[%.*s]\n", skey.len, skey.s);
1139 1151
 		}