Blob Blame History Raw
From: Rob Gagnon <rgagnon@vcentos7.telepointglobal.com>
Date: Thu, 19 Mar 2015 12:30:44 -0400
Subject: [PATCH] Fix functions to match their documented API Change function
 prototypes to use gparam_p instead of char *


diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index 16e2fdc..efc3be2 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -125,6 +125,11 @@ struct ng_flags_parse {
 	bencode_item_t *dict, *flags, *direction, *replace, *rtcp_mux;
 };
 
+typedef struct rtpe_set_link {
+	struct rtpe_set *rset;
+	pv_spec_t rpv;
+} rtpe_set_link_t;
+
 static const char *command_strings[] = {
 	[OP_OFFER]		= "offer",
 	[OP_ANSWER]		= "answer",
@@ -135,18 +140,18 @@ static const char *command_strings[] = {
 
 static char *gencookie();
 static int rtpe_test(struct rtpe_node*, int, int);
-static int start_recording_f(struct sip_msg *, char *, char *);
-static int rtpengine_answer1_f(struct sip_msg *, char *, char *);
-static int rtpengine_offer1_f(struct sip_msg *, char *, char *);
-static int rtpengine_delete1_f(struct sip_msg *, char *, char *);
-static int rtpengine_manage1_f(struct sip_msg *, char *, char *);
+static int start_recording_f(struct sip_msg *);
+static int rtpengine_answer1_f(struct sip_msg *, gparam_p str1);
+static int rtpengine_offer1_f(struct sip_msg *, gparam_p str1);
+static int rtpengine_delete1_f(struct sip_msg *, gparam_p str1);
+static int rtpengine_manage1_f(struct sip_msg *, gparam_p str1);
 
 static int parse_flags(struct ng_flags_parse *, struct sip_msg *, enum rtpe_operation *, const char *);
 
 static int rtpengine_offer_answer(struct sip_msg *msg, const char *flags, int op);
 static int add_rtpengine_socks(struct rtpe_set * rtpe_list, char * rtpengine);
 static int fixup_set_id(void ** param, int param_no);
-static int set_rtpengine_set_f(struct sip_msg * msg, char * str1, char * str2);
+static int set_rtpengine_set_f(struct sip_msg * msg, rtpe_set_link_t *set_param);
 static struct rtpe_set * select_rtpe_set(int id_set);
 static struct rtpe_node *select_rtpe_node(str, int);
 static char *send_rtpe_command(struct rtpe_node *, bencode_item_t *, int *);
@@ -193,11 +198,6 @@ static int *rtpe_socks = 0;
 static int     setid_avp_type;
 static int_str setid_avp;
 
-typedef struct rtpe_set_link {
-	struct rtpe_set *rset;
-	pv_spec_t rpv;
-} rtpe_set_link_t;
-
 /* tm */
 static struct tm_binds tmb;
 
@@ -1691,7 +1691,7 @@ static int rtpengine_delete(struct sip_msg *msg, const char *flags) {
 }
 
 static int
-rtpengine_delete1_f(struct sip_msg* msg, char* str1, char* str2)
+rtpengine_delete1_f(struct sip_msg* msg, gparam_p str1)
 {
 	str flags;
 
@@ -1700,7 +1700,7 @@ rtpengine_delete1_f(struct sip_msg* msg, char* str1, char* str2)
 
 	flags.s = NULL;
 	if (str1)
-		fixup_get_svalue(msg, (gparam_p)str1, &flags);
+		fixup_get_svalue(msg, str1, &flags);
 
 	return rtpengine_delete(msg, flags.s);
 }
@@ -1708,12 +1708,12 @@ rtpengine_delete1_f(struct sip_msg* msg, char* str1, char* str2)
 /* This function assumes p points to a line of requested type. */
 
 static int
-set_rtpengine_set_f(struct sip_msg * msg, char * str1, char * str2)
+set_rtpengine_set_f(struct sip_msg * msg, rtpe_set_link_t *set_param)
 {
 	rtpe_set_link_t *rtpl;
 	pv_value_t val;
 
-	rtpl = (rtpe_set_link_t*)str1;
+	rtpl = set_param;
 
 	current_msg_id = 0;
 	selected_rtpe_set = 0;
@@ -1793,7 +1793,7 @@ rtpengine_manage(struct sip_msg *msg, const char *flags)
 }
 
 static int
-rtpengine_manage1_f(struct sip_msg *msg, char *str1, char *str2)
+rtpengine_manage1_f(struct sip_msg *msg, gparam_p str1)
 {
 	str flags;
 
@@ -1802,13 +1802,13 @@ rtpengine_manage1_f(struct sip_msg *msg, char *str1, char *str2)
 
 	flags.s = NULL;
 	if (str1)
-		fixup_get_svalue(msg, (gparam_p)str1, &flags);
+		fixup_get_svalue(msg, str1, &flags);
 
 	return rtpengine_manage(msg, flags.s);
 }
 
 static int
-rtpengine_offer1_f(struct sip_msg *msg, char *str1, char *str2)
+rtpengine_offer1_f(struct sip_msg *msg, gparam_p str1)
 {
 	str flags;
 
@@ -1817,12 +1817,12 @@ rtpengine_offer1_f(struct sip_msg *msg, char *str1, char *str2)
 
 	flags.s = NULL;
 	if (str1)
-		fixup_get_svalue(msg, (gparam_p)str1, &flags);
+		fixup_get_svalue(msg, str1, &flags);
 	return rtpengine_offer_answer(msg, flags.s, OP_OFFER);
 }
 
 static int
-rtpengine_answer1_f(struct sip_msg *msg, char *str1, char *str2)
+rtpengine_answer1_f(struct sip_msg *msg, gparam_p str1)
 {
 	str flags;
 
@@ -1835,7 +1835,7 @@ rtpengine_answer1_f(struct sip_msg *msg, char *str1, char *str2)
 
 	flags.s = NULL;
 	if (str1)
-		fixup_get_svalue(msg, (gparam_p)str1, &flags);
+		fixup_get_svalue(msg, str1, &flags);
 	return rtpengine_offer_answer(msg, flags.s, OP_ANSWER);
 }
 
@@ -1878,7 +1878,7 @@ error:
 
 
 static int
-start_recording_f(struct sip_msg* msg, char *foo, char *bar)
+start_recording_f(struct sip_msg* msg)
 {
 	return rtpe_function_call_simple(msg, OP_START_RECORDING, NULL);
 }