[sr-dev] git:master:41727b76: topos: store record route set only for initial 200ok response

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 1 13:34:14 CEST 2016


Module: kamailio
Branch: master
Commit: 41727b768406383924d87b3d426d5f79df0f45be
URL: https://github.com/kamailio/kamailio/commit/41727b768406383924d87b3d426d5f79df0f45be

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-09-01T13:33:23+02:00

topos: store record route set only for initial 200ok response

---

Modified: modules/topos/tps_storage.c
Modified: modules/topos/tps_storage.h

---

Diff:  https://github.com/kamailio/kamailio/commit/41727b768406383924d87b3d426d5f79df0f45be.diff
Patch: https://github.com/kamailio/kamailio/commit/41727b768406383924d87b3d426d5f79df0f45be.patch

---

diff --git a/modules/topos/tps_storage.c b/modules/topos/tps_storage.c
index 13c7c77..faf202f 100644
--- a/modules/topos/tps_storage.c
+++ b/modules/topos/tps_storage.c
@@ -1015,6 +1015,7 @@ int tps_storage_update_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd)
 		return 0;
 	}
 
+
 	ret = tps_storage_link_msg(msg, md, md->direction);
 	if(ret<0) return -1;
 
@@ -1044,15 +1045,18 @@ int tps_storage_update_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd)
 	db_uvals[nr_ucols].val.str_val = TPS_STRZ(md->b_contact);
 	nr_ucols++;
 
-	db_ucols[nr_ucols] = &td_col_b_rr;
-	db_uvals[nr_ucols].type = DB1_STR;
-	db_uvals[nr_ucols].val.str_val = TPS_STRZ(md->b_rr);
-	nr_ucols++;
-
 	if(msg->first_line.type==SIP_REPLY) {
 		if(sd->b_tag.len<=0
 				&& msg->first_line.u.reply.statuscode>=200
 				&& msg->first_line.u.reply.statuscode<300) {
+
+			if((sd->iflags&TPS_IFLAG_DLGON) == 0) {
+				db_ucols[nr_ucols] = &td_col_b_rr;
+				db_uvals[nr_ucols].type = DB1_STR;
+				db_uvals[nr_ucols].val.str_val = TPS_STRZ(md->b_rr);
+				nr_ucols++;
+			}
+
 			db_ucols[nr_ucols] = &td_col_b_tag;
 			db_uvals[nr_ucols].type = DB1_STR;
 			db_uvals[nr_ucols].val.str_val = TPS_STRZ(md->b_tag);
@@ -1060,7 +1064,7 @@ int tps_storage_update_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd)
 
 			db_ucols[nr_ucols] = &td_col_iflags;
 			db_uvals[nr_ucols].type = DB1_INT;
-			db_uvals[nr_ucols].val.int_val = 1;
+			db_uvals[nr_ucols].val.int_val = sd->iflags|TPS_IFLAG_DLGON;
 			nr_ucols++;
 		}
 	}
diff --git a/modules/topos/tps_storage.h b/modules/topos/tps_storage.h
index 63793db..ad37048 100644
--- a/modules/topos/tps_storage.h
+++ b/modules/topos/tps_storage.h
@@ -34,6 +34,9 @@
 #define TPS_DIR_DOWNSTREAM	0
 #define TPS_DIR_UPSTREAM	1
 
+#define TPS_IFLAG_INIT	1
+#define TPS_IFLAG_DLGON	2
+
 #define TPS_DATA_SIZE	8192
 typedef struct tps_data {
 	char cbuf[TPS_DATA_SIZE];




More information about the sr-dev mailing list