Module: kamailio
Branch: master
Commit: 22749d33e7d93422a69233a6fb0e60f2f2267c88
URL:
https://github.com/kamailio/kamailio/commit/22749d33e7d93422a69233a6fb0e60f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-08-27T12:16:58+02:00
app_python3: give scan format to PyArg_ParseTuple() via param
---
Modified: src/modules/app_python3/apy_kemi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/22749d33e7d93422a69233a6fb0e60f…
Patch:
https://github.com/kamailio/kamailio/commit/22749d33e7d93422a69233a6fb0e60f…
---
diff --git a/src/modules/app_python3/apy_kemi.c b/src/modules/app_python3/apy_kemi.c
index cc7dfa6ccf..69666e2d5e 100755
--- a/src/modules/app_python3/apy_kemi.c
+++ b/src/modules/app_python3/apy_kemi.c
@@ -746,7 +746,7 @@ PyObject *sr_apy_kemi_return_none_mode(int rmode)
*
*/
static PyObject *sr_apy_kemi_f_pv_get_mode(PyObject *self, PyObject *args,
- int rmode)
+ char *pfmt, int rmode)
{
str pvn;
pv_spec_t *pvs;
@@ -767,7 +767,7 @@ static PyObject *sr_apy_kemi_f_pv_get_mode(PyObject *self, PyObject
*args,
lmsg = env_P->msg;
}
- if(!PyArg_ParseTuple(args, "s:pv.get", &pvn.s)) {
+ if(!PyArg_ParseTuple(args, pfmt, &pvn.s)) {
LM_ERR("unable to retrieve str param\n");
return sr_apy_kemi_return_none_mode(rmode);
}
@@ -809,7 +809,7 @@ static PyObject *sr_apy_kemi_f_pv_get_mode(PyObject *self, PyObject
*args,
*/
static PyObject *sr_apy_kemi_f_pv_get(PyObject *self, PyObject *args)
{
- return sr_apy_kemi_f_pv_get_mode(self, args, 0);
+ return sr_apy_kemi_f_pv_get_mode(self, args, "s:pv.get", 0);
}
/**
@@ -817,7 +817,7 @@ static PyObject *sr_apy_kemi_f_pv_get(PyObject *self, PyObject *args)
*/
static PyObject *sr_apy_kemi_f_pv_getw(PyObject *self, PyObject *args)
{
- return sr_apy_kemi_f_pv_get_mode(self, args, 1);
+ return sr_apy_kemi_f_pv_get_mode(self, args, "s:pv.getw", 1);
}
/**
@@ -825,7 +825,7 @@ static PyObject *sr_apy_kemi_f_pv_getw(PyObject *self, PyObject
*args)
*/
static PyObject *sr_apy_kemi_f_pv_gete(PyObject *self, PyObject *args)
{
- return sr_apy_kemi_f_pv_get_mode(self, args, 2);
+ return sr_apy_kemi_f_pv_get_mode(self, args, "s:pv.gete", 2);
}
/**