Module: kamailio
Branch: master
Commit: c1701cf3e57adbf8448c414bfb8ba10426a69104
URL:
https://github.com/kamailio/kamailio/commit/c1701cf3e57adbf8448c414bfb8ba10…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-08-27T12:18:47+02:00
app_python: give scan format to PyArg_ParseTuple() via param
---
Modified: src/modules/app_python/apy_kemi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c1701cf3e57adbf8448c414bfb8ba10…
Patch:
https://github.com/kamailio/kamailio/commit/c1701cf3e57adbf8448c414bfb8ba10…
---
diff --git a/src/modules/app_python/apy_kemi.c b/src/modules/app_python/apy_kemi.c
index b40c042777..13764664df 100644
--- a/src/modules/app_python/apy_kemi.c
+++ b/src/modules/app_python/apy_kemi.c
@@ -723,7 +723,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;
@@ -744,7 +744,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);
}
@@ -786,7 +786,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);
}
/**
@@ -794,7 +794,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);
}
/**
@@ -802,7 +802,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);
}
/**