Module: kamailio
Branch: master
Commit: 63498d6c2180645562f495077d6b414b12b39820
URL:
https://github.com/kamailio/kamailio/commit/63498d6c2180645562f495077d6b414…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-08-25T16:13:25+02:00
app_python: implemented KSR.pv.gete(...)
---
Modified: src/modules/app_python/apy_kemi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/63498d6c2180645562f495077d6b414…
Patch:
https://github.com/kamailio/kamailio/commit/63498d6c2180645562f495077d6b414…
---
diff --git a/src/modules/app_python/apy_kemi.c b/src/modules/app_python/apy_kemi.c
index 7110912b92..b40c042777 100644
--- a/src/modules/app_python/apy_kemi.c
+++ b/src/modules/app_python/apy_kemi.c
@@ -710,8 +710,10 @@ static sr_kemi_t _sr_apy_kemi_test[] = {
*/
PyObject *sr_apy_kemi_return_none_mode(int rmode)
{
- if(rmode) {
+ if(rmode==1) {
return sr_apy_kemi_return_str(NULL, "<<null>>", 8);
+ } else if(rmode==2) {
+ return sr_apy_kemi_return_str(NULL, "", 0);
} else {
return sr_apy_kemi_return_none();
}
@@ -795,6 +797,14 @@ static PyObject *sr_apy_kemi_f_pv_getw(PyObject *self, PyObject
*args)
return sr_apy_kemi_f_pv_get_mode(self, args, 1);
}
+/**
+ *
+ */
+static PyObject *sr_apy_kemi_f_pv_gete(PyObject *self, PyObject *args)
+{
+ return sr_apy_kemi_f_pv_get_mode(self, args, 2);
+}
+
/**
*
*/
@@ -1028,6 +1038,8 @@ static PyMethodDef _sr_apy_kemi_pv_Methods[] = {
NAME " - pv get value"},
{"getw", sr_apy_kemi_f_pv_getw, METH_VARARGS,
NAME " - pv get value or <<null>>"},
+ {"gete", sr_apy_kemi_f_pv_gete, METH_VARARGS,
+ NAME " - pv get value or empty string"},
{"seti", sr_apy_kemi_f_pv_seti, METH_VARARGS,
NAME " - pv set int value"},
{"sets", sr_apy_kemi_f_pv_sets, METH_VARARGS,