[sr-dev] git:master:2ffee710: sipcapture: removed unused param from w_float2int()

Daniel-Constantin Mierla miconda at gmail.com
Wed Nov 1 10:32:24 CET 2017


Module: kamailio
Branch: master
Commit: 2ffee710e208fee7facaa013d3b233b264781b25
URL: https://github.com/kamailio/kamailio/commit/2ffee710e208fee7facaa013d3b233b264781b25

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-11-01T09:58:45+01:00

sipcapture: removed unused param from w_float2int()

- dedicated wrappers for cfg exported report_capture() variants

---

Modified: src/modules/sipcapture/sipcapture.c

---

Diff:  https://github.com/kamailio/kamailio/commit/2ffee710e208fee7facaa013d3b233b264781b25.diff
Patch: https://github.com/kamailio/kamailio/commit/2ffee710e208fee7facaa013d3b233b264781b25.patch

---

diff --git a/src/modules/sipcapture/sipcapture.c b/src/modules/sipcapture/sipcapture.c
index d18424bb1a..4a4da5e131 100644
--- a/src/modules/sipcapture/sipcapture.c
+++ b/src/modules/sipcapture/sipcapture.c
@@ -151,9 +151,11 @@ static int w_sip_capture1(sip_msg_t *_m, char *_table, char *_p2);
 static int w_sip_capture2(sip_msg_t *_m, char *_table, char *_cmdata);
 static int w_sip_capture(struct sip_msg *_m, char *_table,
 		_capture_mode_data_t *_cm_data);
-static int w_report_capture(sip_msg_t *_m, char *_table, char *_corr,
+static int w_report_capture1(sip_msg_t *_m, char *_table, char *_p2);
+static int w_report_capture2(sip_msg_t *_m, char *_table, char *_corr);
+static int w_report_capture3(sip_msg_t *_m, char *_table, char *_corr,
 		char *_data);
-static int w_float2int(sip_msg_t *_m, char *_val, char *_coof, char *s2);
+static int w_float2int(sip_msg_t *_m, char *_val, char *_coof);
 
 static int sipcapture_parse_aleg_callid_headers();
 int parse_aleg_callid_headers(str *headers_str, str *headers);
@@ -299,11 +301,11 @@ static cmd_export_t cmds[] = {
 		ANY_ROUTE},
 	{"sip_capture", (cmd_function)w_sip_capture2, 2, sipcapture_fixup, 0,
 		ANY_ROUTE},
-	{"report_capture", (cmd_function)w_report_capture, 1,
+	{"report_capture", (cmd_function)w_report_capture1, 1,
 		reportcapture_fixup, 0, ANY_ROUTE},
-	{"report_capture", (cmd_function)w_report_capture, 2,
+	{"report_capture", (cmd_function)w_report_capture2, 2,
 		reportcapture_fixup, 0, ANY_ROUTE},
-	{"report_capture", (cmd_function)w_report_capture, 3,
+	{"report_capture", (cmd_function)w_report_capture3, 3,
 		reportcapture_fixup, 0, ANY_ROUTE},
 	{"float2int", (cmd_function)w_float2int, 2, float2int_fixup, 0,
 		ANY_ROUTE},
@@ -1066,7 +1068,7 @@ static int float2int_fixup(void **param, int param_no)
 }
 
 
-static int w_float2int(struct sip_msg *_m, char *_val, char *_coof, char *s2)
+static int w_float2int(sip_msg_t *_m, char *_val, char *_coof)
 {
 	str value = {0};
 	str coof = {0};
@@ -1090,7 +1092,6 @@ static int w_float2int(struct sip_msg *_m, char *_val, char *_coof, char *s2)
 	return ret ? ret : -1;
 }
 
-
 static int w_sip_capture(sip_msg_t *_m, char *_table,
 		_capture_mode_data_t *cm_data)
 {
@@ -1119,7 +1120,17 @@ static int w_sip_capture2(sip_msg_t *_m, char *_table, char *_cmdata)
 	return w_sip_capture(_m, _table, (_capture_mode_data_t*)_cmdata);
 }
 
-static int w_report_capture(sip_msg_t *_m, char *_table, char *_corr,
+static int w_report_capture1(sip_msg_t *_m, char *_table, char *_p2)
+{
+	return w_report_capture3(_m, _table, NULL, NULL);
+}
+
+static int w_report_capture2(sip_msg_t *_m, char *_table, char *_corr)
+{
+	return w_report_capture3(_m, _table, _corr, NULL);
+}
+
+static int w_report_capture3(sip_msg_t *_m, char *_table, char *_corr,
 		char *_data)
 {
 	str table = {0};
@@ -2358,7 +2369,8 @@ static const char *sipcapture_status_doc[2] = {
 
 rpc_export_t sipcapture_rpc[] = {
 	{"sipcapture.status", sipcapture_rpc_status, sipcapture_status_doc, 0},
-	{0, 0, 0, 0}};
+	{0, 0, 0, 0}
+};
 
 static int sipcapture_init_rpc(void)
 {
@@ -2559,8 +2571,7 @@ int receive_logging_json_msg(char *buf, unsigned int len,
 	return -1;
 }
 
-static int report_capture(
-		struct sip_msg *msg, str *_table, str *_corr, str *_data)
+static int report_capture(sip_msg_t *msg, str *_table, str *_corr, str *_data)
 {
 	struct _sipcapture_object sco;
 	db_key_t db_keys[RTCP_NR_KEYS];
@@ -2630,7 +2641,6 @@ static int report_capture(
 		sco.node.s = tmp_node;
 		sco.node.len = strlen(tmp_node);
 		epoch_time_as_time_t = heptime->tv_sec;
-		;
 	} else {
 		sco.tmstamp = (unsigned long long)tvb.tv_sec * 1000000
 			+ tvb.tv_usec; /* micro ts */




More information about the sr-dev mailing list