[sr-dev] git:master:77896de7: secsipid: added kemi function to get $secsioid(val)

Daniel-Constantin Mierla miconda at gmail.com
Tue Jun 22 11:21:47 CEST 2021


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-06-22T11:20:42+02:00

secsipid: added kemi function to get $secsioid(val)

---

Modified: src/modules/secsipid/secsipid_mod.c

---

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

---

diff --git a/src/modules/secsipid/secsipid_mod.c b/src/modules/secsipid/secsipid_mod.c
index 6a42076c0b..27216e1cec 100644
--- a/src/modules/secsipid/secsipid_mod.c
+++ b/src/modules/secsipid/secsipid_mod.c
@@ -815,6 +815,23 @@ static int pv_parse_secsipid_name(pv_spec_p sp, str *in)
 
 }
 
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_secsipid_get_val(sip_msg_t *msg)
+{
+	memset(&_sr_kemi_secsipid_xval, 0, sizeof(sr_kemi_xval_t));
+	if(_secsipid_data.value.s==NULL || _secsipid_data.value.len<=0) {
+		sr_kemi_xval_null(&_sr_kemi_secsipid_xval, SR_KEMI_XVAL_NULL_EMPTY);
+		return &_sr_kemi_secsipid_xval;
+	}
+	_sr_kemi_secsipid_xval.vtype = SR_KEMIP_STR;
+	_sr_kemi_secsipid_xval.v.s = _secsipid_data.value;
+
+	return &_sr_kemi_secsipid_xval;
+}
+
 /**
  *
  */
@@ -845,6 +862,11 @@ static sr_kemi_t sr_kemi_secsipid_exports[] = {
 		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
 			SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR }
 	},
+	{ str_init("secsipid"), str_init("secsipid_get_val"),
+		SR_KEMIP_XVAL, ki_secsipid_get_val,
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+	},
 	{ str_init("secsipid"), str_init("secsipid_get_url"),
 		SR_KEMIP_XVAL, ki_secsipid_get_url,
 		{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,




More information about the sr-dev mailing list