[sr-dev] git:master:36a704e8: core: pv - helper function to return empty string

Daniel-Constantin Mierla miconda at gmail.com
Thu Oct 1 09:28:02 CEST 2015


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-10-01T09:11:11+02:00

core: pv - helper function to return empty string

---

Modified: pvapi.c
Modified: pvar.h

---

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

---

diff --git a/pvapi.c b/pvapi.c
index 3918895..e9b557e 100644
--- a/pvapi.c
+++ b/pvapi.c
@@ -611,6 +611,21 @@ int pv_get_null(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
 /**
  *
  */
+int pv_get_strempty(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
+{
+	if(res==NULL)
+		return -1;
+
+	res->rs = pv_str_empty;
+	res->ri = 0;
+	res->flags = PV_VAL_STR;
+	return 0;
+}
+
+
+/**
+ *
+ */
 pv_export_t* pv_lookup_spec_name(str *pvname, pv_spec_p e)
 {
 	pv_item_t *pvi;
diff --git a/pvar.h b/pvar.h
index 3bdfe17..8cc8488 100644
--- a/pvar.h
+++ b/pvar.h
@@ -210,6 +210,7 @@ str* pv_cache_get_name(pv_spec_t *spec);
 
 /*! \brief PV helper functions */
 int pv_get_null(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
+int pv_get_strempty(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
 
 int pv_get_uintval(struct sip_msg *msg, pv_param_t *param,
 		pv_value_t *res, unsigned int uival);




More information about the sr-dev mailing list