[sr-dev] git:5.1:e27ad201: acc_diameter: use acc api to parse extra string

Daniel-Constantin Mierla miconda at gmail.com
Sat Dec 9 14:00:52 CET 2017


Module: kamailio
Branch: 5.1
Commit: e27ad201d430636a4b699054dffea4e4b4dc967a
URL: https://github.com/kamailio/kamailio/commit/e27ad201d430636a4b699054dffea4e4b4dc967a

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-12-09T13:57:37+01:00

acc_diameter: use acc api to parse extra string

- remove inline to avoid missing symbol in linker

(cherry picked from commit fc65848a680006a37b71dbdad21bdc9902eff22f)

---

Modified: src/modules/acc_diameter/acc_diameter_mod.c
Modified: src/modules/acc_diameter/diam_avp.c

---

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

---

diff --git a/src/modules/acc_diameter/acc_diameter_mod.c b/src/modules/acc_diameter/acc_diameter_mod.c
index 7e2b379810..d82e541b0c 100644
--- a/src/modules/acc_diameter/acc_diameter_mod.c
+++ b/src/modules/acc_diameter/acc_diameter_mod.c
@@ -137,7 +137,7 @@ static int mod_init( void )
 
 	/* parse the extra string, if any */
 	if (diameter_extra_str
-			&& (diameter_extra=parse_acc_extra(diameter_extra_str))==0 ) {
+			&& (diameter_extra=accb.parse_extra(diameter_extra_str))==0 ) {
 		LM_ERR("failed to parse diameter_extra param\n");
 		return -1;
 	}
@@ -191,11 +191,22 @@ static int child_init(int rank)
 }
 
 
+static void diam_destroy_extras(acc_extra_t *extra)
+{
+	acc_extra_t *foo;
+
+	while (extra) {
+		foo = extra;
+		extra = extra->next;
+		pkg_free(foo);
+	}
+}
+
 static void destroy(void)
 {
 	close_tcp_connection(sockfd);
 	if (diameter_extra)
-		destroy_extras( diameter_extra);
+		diam_destroy_extras(diameter_extra);
 }
 
 /************************** FIXUP functions ****************************/
@@ -287,7 +298,7 @@ int acc_diam_init(acc_extra_t *leg_info)
 }
 
 
-inline unsigned long diam_status(struct sip_msg *rq, int code)
+int diam_status(struct sip_msg *rq, int code)
 {
 	if ((rq->REQ_METHOD==METHOD_INVITE || rq->REQ_METHOD==METHOD_ACK)
 			&& code>=200 && code<300)
diff --git a/src/modules/acc_diameter/diam_avp.c b/src/modules/acc_diameter/diam_avp.c
index 2ea5a577fa..038f6c8eba 100644
--- a/src/modules/acc_diameter/diam_avp.c
+++ b/src/modules/acc_diameter/diam_avp.c
@@ -41,7 +41,7 @@
  * All this default values (for flags and data-type) are correct/set by this
  * function.
  */
-inline void set_avp_fields( AAA_AVPCode code, AAA_AVP *avp)
+void set_avp_fields( AAA_AVPCode code, AAA_AVP *avp)
 {
 	switch (code) {
 		case   1: /*AVP_User_Name*/




More information about the sr-dev mailing list