[sr-dev] git:master:157892f3: siptrace: Minor code fixes; remove useless error logs

Henning Westerholt henningw at users.noreply.github.com
Tue Apr 9 21:26:01 CEST 2019


Module: kamailio
Branch: master
Commit: 157892f358ed0cf62c59d884dde171b2aaaf791e
URL: https://github.com/kamailio/kamailio/commit/157892f358ed0cf62c59d884dde171b2aaaf791e

Author: iionita <ionut-razvan.ionita at 1and1.ro>
Committer: Henning Westerholt <henningw at users.noreply.github.com>
Date: 2019-04-09T21:25:53+02:00

siptrace: Minor code fixes; remove useless error logs

---

Modified: src/modules/siptrace/siptrace.c

---

Diff:  https://github.com/kamailio/kamailio/commit/157892f358ed0cf62c59d884dde171b2aaaf791e.diff
Patch: https://github.com/kamailio/kamailio/commit/157892f358ed0cf62c59d884dde171b2aaaf791e.patch

---

diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 48fa9b97b4..f4cca2c1c8 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -352,14 +352,6 @@ static int mod_init(void)
 		}
 	}
 
-#if 0
-	else if(tmb.register_tmcb(0, 0, TMCB_REQUEST_IN, trace_onreq_in, 0, 0)
-			  <= 0) {
-		LM_ERR("can't register trace_onreq_in\n");
-		return -1;
-	}
-#endif
-
 	/* bind the SL API */
 	if(sl_load_api(&slb) != 0) {
 		LM_WARN("cannot bind to SL API. Will not install sl callbacks.\n");
@@ -712,9 +704,8 @@ enum siptrace_type_t parse_siptrace_flag(str* sflags)
 			case '\t':
 				break;
 			default:
-				LM_ERR("idx %d %d\n", idx, sflags->len);
-				LM_ERR("Invalid character <%c> in <%.*s>!\n", sflags->s[idx],
-						sflags->len, sflags->s);
+				LM_ERR("Invalid character <%c> in <%.*s> at position <%d>!\n", sflags->s[idx],
+						sflags->len, sflags->s, idx);
 				return SIPTRACE_NONE;
 		}
 	}
@@ -727,7 +718,6 @@ static int fixup_siptrace(void **param, int param_no)
 	str sflags;
 	enum siptrace_type_t trace_type;
 
-	LM_ERR("fixup function aaa\n");
 	if(param_no < 1 || param_no > 3) {
 		LM_DBG("params:%s\n", (char *)*param);
 		return 0;
@@ -738,8 +728,8 @@ static int fixup_siptrace(void **param, int param_no)
 		return fixup_spve_spve(param, param_no);
 	} else if (param_no == 3) {
 		/* tracing type; string only */
-		sflags.s = *param;
-		sflags.len = strlen(*param);
+		sflags.s = (char *)*param;
+		sflags.len = strlen(sflags.s);
 
 		trace_type = parse_siptrace_flag(&sflags);
 		if (trace_type == SIPTRACE_NONE) {
@@ -960,7 +950,8 @@ static int w_sip_trace3(sip_msg_t *msg, char *dest, char *correlation_id, char *
 		} else if (trace_type == SIPTRACE_DIALOG) {
 			trace_transaction(msg, info, 1);
 			if (unlikely(dlgb.set_dlg_var == NULL)) {
-				LM_ERR("Dialog api not loaded! will trace only current transaction!\n");
+				/* FIXME should we abort tracing here? */
+				LM_WARN("Dialog api not loaded! will trace only current transaction!\n");
 			} else {
 				/* serialize what's in info */
 				/* save correlation id in siptrace_info avp
@@ -1626,7 +1617,6 @@ static void trace_transaction(sip_msg_t* msg, siptrace_info_t* info, int registe
 	/* trace current message on out */
 	msg->msg_flags |= FL_SIPTRACE;
 
-	LM_ERR("trace request out registration\n");
 	if(tmb.register_tmcb(msg, 0, TMCB_REQUEST_SENT, trace_onreq_out, info, 0) <= 0) {
 		LM_ERR("can't register trace_onreq_out\n");
 		return;
@@ -1639,7 +1629,6 @@ static void trace_transaction(sip_msg_t* msg, siptrace_info_t* info, int registe
 	}
 
 	/* trace reply on out */
-	LM_CRIT("trace resp sent!\n");
 	if(tmb.register_tmcb(msg, 0, TMCB_RESPONSE_SENT, trace_onreply_out, info, register_free_func ? free_trace_info : 0)
 			<= 0) {
 		LM_ERR("can't register trace_onreply_out\n");
@@ -1666,8 +1655,6 @@ static void trace_dialog(struct dlg_cell* dlg, int type, struct dlg_cb_params *p
 	int_str avp_value;
 	struct usr_avp* avp = NULL;
 
-	LM_ERR("TRACING THIS DIALOGHES!\n");
-
 	if (!dlgb.get_dlg) {
 		LM_ERR("Dialog API not loaded! Trace off...\n");
 		return;
@@ -1709,11 +1696,6 @@ static void trace_dialog(struct dlg_cell* dlg, int type, struct dlg_cb_params *p
 		return;
 	}
 
-	/* flag for stateless replies?? */
-
-	/* trace negative ACKS? */
-	/* trace 180? */
-	/* trace CANCEL and BYE transactions */
 	return;
 }
 




More information about the sr-dev mailing list