Browse code

topos_redis: do rr update for requests within dialog based of flags

balajee authored on 07/01/2021 08:38:15 • Daniel-Constantin Mierla committed on 07/01/2021 09:24:13
Showing 1 changed files
... ...
@@ -1283,6 +1283,21 @@ int tps_redis_update_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd,
1283 1283
 		}
1284 1284
 	}
1285 1285
 
1286
+        if(sd->b_tag.len>0 && ((mode & TPS_DBU_BRR) || (mode & TPS_DBU_ARR))) {
1287
+                if(((md->direction == TPS_DIR_DOWNSTREAM) && (msg->first_line.type==SIP_REPLY)) ||
1288
+                                ((md->direction == TPS_DIR_UPSTREAM) && (msg->first_line.type==SIP_REQUEST))) {
1289
+                        if(((sd->iflags&TPS_IFLAG_DLGON) == 0) && (mode & TPS_DBU_BRR)) {
1290
+                                TPS_REDIS_SET_ARGS(&md->b_rr, argc, &td_key_b_rr, argv, argvlen);
1291
+                        }
1292
+                }
1293
+                else {
1294
+                        if(((sd->iflags&TPS_IFLAG_DLGON) == 0) && (mode & TPS_DBU_ARR)) {
1295
+                                TPS_REDIS_SET_ARGS(&md->a_rr, argc, &td_key_a_rr, argv, argvlen);
1296
+                                TPS_REDIS_SET_ARGS(&md->s_rr, argc, &td_key_s_rr, argv, argvlen);
1297
+                        }
1298
+                }
1299
+        }
1300
+
1286 1301
 	if(argc<=2) {
1287 1302
 		return 0;
1288 1303
 	}