Browse code

topos: use context for sruid

Daniel-Constantin Mierla authored on 31/03/2021 22:01:22
Showing 1 changed files
... ...
@@ -64,6 +64,9 @@ extern pv_spec_t _tps_bcontact_spec;
64 64
 extern str _tps_contact_host_avp;
65 65
 extern pv_spec_t _tps_contact_host_avp_spec;
66 66
 
67
+extern str _tps_context_param;
68
+extern str _tps_context_value;
69
+
67 70
 #define TPS_STORAGE_LOCK_SIZE	1<<9
68 71
 static gen_lock_set_t *_tps_storage_lock_set = NULL;
69 72
 
... ...
@@ -546,9 +549,16 @@ int tps_storage_record(sip_msg_t *msg, tps_data_t *td, int dialog, int dir)
546 549
 {
547 550
 	int ret = -1; /* error if dialog == 0 */
548 551
 	str suid;
552
+	str *sx = NULL;
553
+
554
+	if(_tps_context_value.len>0) {
555
+		sx = &_tps_context_value;
556
+	} else if(_tps_context_param.len>0) {
557
+		sx = &_tps_context_param;
558
+	}
549 559
 
550 560
 	if(dialog==0) {
551
-		sruid_next(&_tps_sruid);
561
+		sruid_nextx(&_tps_sruid, sx);
552 562
 		suid = _tps_sruid.uid;
553 563
 	} else {
554 564
 		if(td->a_uuid.len>0) {