[sr-dev] git:master:6b65ff70: nathelper: export add_rcv_param(flags) to kemi interface

Daniel-Constantin Mierla miconda at gmail.com
Sat Nov 18 16:27:30 CET 2017


Module: kamailio
Branch: master
Commit: 6b65ff70d505680fa3904f659c47d466e77b38c6
URL: https://github.com/kamailio/kamailio/commit/6b65ff70d505680fa3904f659c47d466e77b38c6

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-11-18T16:26:29+01:00

nathelper: export add_rcv_param(flags) to kemi interface

---

Modified: src/modules/nathelper/nathelper.c

---

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

---

diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c
index d6878e3176..a34d0a19dd 100644
--- a/src/modules/nathelper/nathelper.c
+++ b/src/modules/nathelper/nathelper.c
@@ -2097,20 +2097,12 @@ static int create_rcv_uri(str *uri, struct sip_msg *m)
  * Add received parameter to Contacts for further
  * forwarding of the REGISTER requuest
  */
-static int add_rcv_param_f(struct sip_msg *msg, char *str1, char *str2)
+static int ki_add_rcv_param(sip_msg_t *msg, int hdr_param)
 {
 	contact_t *c;
 	struct lump *anchor;
 	char *param;
 	str uri;
-	int hdr_param = 0;
-
-	if(str1) {
-		if(fixup_get_ivalue(msg, (gparam_t*)str1, &hdr_param)<0) {
-			LM_ERR("failed to get falgs parameter\n");
-			return -1;
-		}
-	}
 
 	if(create_rcv_uri(&uri, msg) < 0) {
 		return -1;
@@ -2160,6 +2152,22 @@ static int add_rcv_param_f(struct sip_msg *msg, char *str1, char *str2)
 	return 1;
 }
 
+/*
+ * Add received parameter to Contacts for further
+ * forwarding of the REGISTER requuest
+ */
+static int add_rcv_param_f(struct sip_msg *msg, char *str1, char *str2)
+{
+	int hdr_param = 0;
+
+	if(str1) {
+		if(fixup_get_ivalue(msg, (gparam_t*)str1, &hdr_param)<0) {
+			LM_ERR("failed to get falgs parameter\n");
+			return -1;
+		}
+	}
+	return ki_add_rcv_param(msg, hdr_param);
+}
 
 /*
  * Create an AVP to be used by registrar with the source IP and port
@@ -2399,6 +2407,11 @@ static sr_kemi_t sr_kemi_nathelper_exports[] = {
 		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
 	},
+	{ str_init("nathelper"), str_init("add_rcv_param"),
+		SR_KEMIP_INT, ki_add_rcv_param,
+		{ SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+	},
 
 	{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
 };




More information about the sr-dev mailing list