Change in ...osmo-sip-connector[master]: Logging: Make use of Levels

keith gerrit-no-reply at lists.osmocom.org
Wed Aug 7 08:06:36 UTC 2019


keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sip-connector/+/15078


Change subject: Logging: Make use of Levels
......................................................................

Logging: Make use of Levels

Up to now most logging is on LDEBUG, lets make more use of Log Levels.
NOTICE reports basic call setup
INFO gives a little more
DEBUG, well.. it's DEBUG

Also, a 4XX or 5XX response to INVITE is not an Error
so don't log it as such. Also 183 does not necessarily
mean "ringing". Change those log messages for clarity.

Change-Id: Ie0014043d93303a87cbb8bb351e439ff78651cbe
---
M src/mncc.c
M src/sip.c
2 files changed, 12 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/78/15078/1

diff --git a/src/mncc.c b/src/mncc.c
index d8545da..90eddc1 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -422,7 +422,7 @@
 	/* TODO.. now we can continue with the call */
 	struct in_addr net = { .s_addr = leg->base.ip };
 	inet_ntop(AF_INET, &net, ip_addr, sizeof(ip_addr));
-	LOGP(DMNCC, LOGL_DEBUG,
+	LOGP(DMNCC, LOGL_INFO,
 		"RTP continue leg(%u) ip(%s), port(%u) pt(%u) ptm(%u)\n",
 		leg->callref, ip_addr, leg->base.port,
 		leg->base.payload_type, leg->base.payload_msg_type);
@@ -515,7 +515,7 @@
 	memcpy(&leg->calling, &data->calling, sizeof(leg->calling));
 	memcpy(&leg->imsi, data->imsi, sizeof(leg->imsi));
 
-	LOGP(DMNCC, LOGL_DEBUG,
+	LOGP(DMNCC, LOGL_NOTICE,
 		"Created call(%u) with MNCC leg(%u) IMSI(%.16s)\n",
 		call->id, leg->callref, data->imsi);
 
diff --git a/src/sip.c b/src/sip.c
index 327e90f..c1e34d3 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -76,7 +76,7 @@
 	if (status == 183)
 		sdp_extract_sdp(leg, sip, false);
 
-	LOGP(DSIP, LOGL_NOTICE, "leg(%p) is now ringing.\n", leg);
+	LOGP(DSIP, LOGL_INFO, "leg(%p) is now progressing.\n", leg);
 	other->ring_call(other);
 }
 
@@ -98,7 +98,7 @@
 		return;
 	}
 
-	LOGP(DSIP, LOGL_NOTICE, "leg(%p) is now connected(%s).\n", leg, sip->sip_call_id->i_id);
+	LOGP(DSIP, LOGL_INFO, "leg(%p) is now connected(%s).\n", leg, sip->sip_call_id->i_id);
 	leg->state = SIP_CC_CONNECTED;
 	other->connect_call(other);
 	nua_ack(leg->nua_handle, TAG_END());
@@ -112,7 +112,7 @@
 	const char *from = NULL, *to = NULL;
 	char ip_addr[INET_ADDRSTRLEN];
 
-	LOGP(DSIP, LOGL_DEBUG, "Incoming call(%s) handle(%p)\n", sip->sip_call_id->i_id, nh);
+	LOGP(DSIP, LOGL_INFO, "Incoming call(%s) handle(%p)\n", sip->sip_call_id->i_id, nh);
 
 	if (!sdp_screen_sdp(sip)) {
 		LOGP(DSIP, LOGL_ERROR, "No supported codec.\n");
@@ -161,7 +161,7 @@
 	}
 	struct in_addr net = { .s_addr = leg->base.ip };
 	inet_ntop(AF_INET, &net, ip_addr, sizeof(ip_addr));
-	LOGP(DSIP, LOGL_DEBUG, "SDP Extracted: IP=(%s) PORT=(%u) PAYLOAD=(%u).\n",
+	LOGP(DSIP, LOGL_INFO, "SDP Extracted: IP=(%s) PORT=(%u) PAYLOAD=(%u).\n",
 		               ip_addr,
 		               leg->base.port,
 		               leg->base.payload_type);
@@ -343,13 +343,13 @@
 		else if (status >= 300) {
 			struct call_leg *other = call_leg_other(&leg->base);
 
-			LOGP(DSIP, LOGL_ERROR, "leg(%p) unknown SIP status(%d), releasing.\n", leg, status);
+			LOGP(DSIP, LOGL_NOTICE, "INVITE got status(%d), releasing leg(%p).\n", status, leg);
 			nua_cancel(leg->nua_handle, TAG_END());
 			nua_handle_destroy(leg->nua_handle);
 			call_leg_release(&leg->base);
 
 			if (other) {
-				LOGP(DSIP, LOGL_DEBUG, "Releasing other leg (%p) with status(%d)\n", other, status);
+				LOGP(DSIP, LOGL_INFO, "Releasing MNCC leg (%p) with status(%d)\n", other, status);
 				other->cause = status2cause(status);
 				other->release_call(other);
 			}
@@ -365,7 +365,7 @@
 	} else if (event == nua_r_bye || event == nua_r_cancel) {
 		/* our bye or hang up is answered */
 		struct sip_call_leg *leg = (struct sip_call_leg *) hmagic;
-		LOGP(DSIP, LOGL_NOTICE, "leg(%p) got resp to %s\n",
+		LOGP(DSIP, LOGL_INFO, "leg(%p) got resp to %s\n",
 			leg, event == nua_r_bye ? "bye" : "cancel");
 		nua_handle_destroy(leg->nua_handle);
 		call_leg_release(&leg->base);
@@ -374,7 +374,7 @@
 		struct sip_call_leg *leg = (struct sip_call_leg *) hmagic;
 		struct call_leg *other = call_leg_other(&leg->base);
 
-		LOGP(DSIP, LOGL_ERROR, "leg(%p) got bye, releasing.\n", leg);
+		LOGP(DSIP, LOGL_NOTICE, "leg(%p) got bye, releasing.\n", leg);
 		nua_handle_destroy(leg->nua_handle);
 		call_leg_release(&leg->base);
 
@@ -395,7 +395,7 @@
 		struct sip_call_leg *leg;
 		struct call_leg *other;
 
-		LOGP(DSIP, LOGL_ERROR, "Cancelled on leg(%p)\n", hmagic);
+		LOGP(DSIP, LOGL_NOTICE, "Cancelled on leg(%p)\n", hmagic);
 
 		leg = (struct sip_call_leg *) hmagic;
 		other = call_leg_other(&leg->base);
@@ -447,7 +447,7 @@
 	 * to help us here.
 	 */
 
-	LOGP(DSIP, LOGL_DEBUG, "%s(): Release with MNCC cause(%s)\n", __func__, gsm48_cc_cause_name(_leg->cause));
+	LOGP(DSIP, LOGL_INFO, "%s(): Release with MNCC cause(%s)\n", __func__, gsm48_cc_cause_name(_leg->cause));
 	cause2status(_leg->cause, &sip_cause, &sip_phrase, &reason_text);
 	snprintf(reason, sizeof reason, "Q.850;cause=%u;text=\"%s\"", _leg->cause, reason_text);
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15078
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: Ie0014043d93303a87cbb8bb351e439ff78651cbe
Gerrit-Change-Number: 15078
Gerrit-PatchSet: 1
Gerrit-Owner: keith <keith at rhizomatica.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190807/ab37db2f/attachment.html>


More information about the gerrit-log mailing list