[sr-dev] git:master:e63e182b: kemix: functions to return from-uri user and host

Daniel-Constantin Mierla miconda at gmail.com
Wed Jun 19 08:38:22 CEST 2019


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-06-19T08:37:37+02:00

kemix: functions to return from-uri user and host

---

Modified: src/modules/kemix/kemix_mod.c

---

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

---

diff --git a/src/modules/kemix/kemix_mod.c b/src/modules/kemix/kemix_mod.c
index add50f09cb..a01a72f7a3 100644
--- a/src/modules/kemix/kemix_mod.c
+++ b/src/modules/kemix/kemix_mod.c
@@ -272,6 +272,71 @@ static sr_kemi_xval_t* ki_kx_gete_rhost(sip_msg_t *msg)
 	return ki_kx_get_ruri_attr(msg, 2, SR_KEMI_XVAL_NULL_EMPTY);
 }
 
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_kx_get_furi_attr(sip_msg_t *msg, int iattr, int xmode)
+{
+	sip_uri_t *uri;
+
+	memset(&_sr_kemi_kx_xval, 0, sizeof(sr_kemi_xval_t));
+	uri=parse_from_uri(msg);
+	if(uri==NULL) {
+		sr_kemi_xval_null(&_sr_kemi_kx_xval, xmode);
+		return &_sr_kemi_kx_xval;
+	}
+
+	return ki_kx_get_xuri_attr(msg, uri, iattr, xmode);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_kx_get_fuser(sip_msg_t *msg)
+{
+	return ki_kx_get_furi_attr(msg, 1, SR_KEMI_XVAL_NULL_NONE);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_kx_getw_fuser(sip_msg_t *msg)
+{
+	return ki_kx_get_furi_attr(msg, 1, SR_KEMI_XVAL_NULL_PRINT);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_kx_gete_fuser(sip_msg_t *msg)
+{
+	return ki_kx_get_furi_attr(msg, 1, SR_KEMI_XVAL_NULL_EMPTY);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_kx_get_fhost(sip_msg_t *msg)
+{
+	return ki_kx_get_furi_attr(msg, 2, SR_KEMI_XVAL_NULL_NONE);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_kx_getw_fhost(sip_msg_t *msg)
+{
+	return ki_kx_get_furi_attr(msg, 2, SR_KEMI_XVAL_NULL_PRINT);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_kx_gete_fhost(sip_msg_t *msg)
+{
+	return ki_kx_get_furi_attr(msg, 2, SR_KEMI_XVAL_NULL_EMPTY);
+}
+
 /**
  *
  */




More information about the sr-dev mailing list