[PATCH 04/10] mgcp/rtp: Change the log message shown when the SSRC changes

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jacob Erlbeck jerlbeck at sysmocom.de
Thu Dec 5 16:44:19 UTC 2013


Show old and new SSRC. Move logging command upward to show the values
immediately after the change has been detected and before any fixing
attempt is made.

Sponsored-by: On-Waves ehf
---
 openbsc/src/libmgcp/mgcp_network.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 367cebd..d19b56e 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -249,6 +249,15 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
 			endp->conn_mode);
 	} else if (state->in_stream.ssrc != rtp_hdr->ssrc) {
 		int32_t tsdelta = state->out_stream.last_tsdelta;
+
+		LOGP(DMGCP, LOGL_NOTICE,
+			"The SSRC changed on 0x%x: %u -> %u  "
+			"from %s:%d in %d\n",
+			ENDPOINT_NUMBER(endp),
+			state->in_stream.ssrc, rtp_hdr->ssrc,
+			inet_ntoa(addr->sin_addr), ntohs(addr->sin_port),
+			endp->conn_mode);
+
 		if (tsdelta == 0) {
 			tsdelta = rtp_end->rate * rtp_end->frames_per_packet *
 				rtp_end->frame_duration_num /
@@ -265,13 +274,6 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
 		state->timestamp_offset =
 			(state->out_stream.last_timestamp + tsdelta) - timestamp;
 		state->patch = rtp_end->force_constant_ssrc;
-		LOGP(DMGCP, LOGL_NOTICE,
-			"The SSRC changed on 0x%x SSRC: %u offset: %d tsdelta: %d "
-			"from %s:%d in %d\n",
-			ENDPOINT_NUMBER(endp), state->in_stream.ssrc,
-			state->seq_offset, tsdelta,
-			inet_ntoa(addr->sin_addr), ntohs(addr->sin_port),
-			endp->conn_mode);
 
 		state->in_stream.last_tsdelta = 0;
 	} else {
-- 
1.7.9.5





More information about the OpenBSC mailing list