Module: kamailio
Branch: master
Commit: e91d9562689dc879540d8b04a337dcd016de4a21
URL:
https://github.com/kamailio/kamailio/commit/e91d9562689dc879540d8b04a337dcd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-28T14:06:19+02:00
core: kemi - defines for modes used to return null string
---
Modified: src/core/kemi.c
Modified: src/core/kemi.h
---
Diff:
https://github.com/kamailio/kamailio/commit/e91d9562689dc879540d8b04a337dcd…
Patch:
https://github.com/kamailio/kamailio/commit/e91d9562689dc879540d8b04a337dcd…
---
diff --git a/src/core/kemi.c b/src/core/kemi.c
index 037532f96b..e4403af9d0 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -2018,10 +2018,10 @@ static sr_kemi_t _sr_kemi_hdr[] = {
*/
void sr_kemi_xval_null(sr_kemi_xval_t *xval, int rmode)
{
- if(rmode==1) {
+ if(rmode==SR_KEMI_XVAL_NULL_PRINT) {
xval->vtype = SR_KEMIP_STR;
xval->v.s = *pv_get_null_str();
- } else if(rmode==2) {
+ } else if(rmode==SR_KEMI_XVAL_NULL_EMPTY) {
xval->vtype = SR_KEMIP_STR;
xval->v.s = *pv_get_empty_str();
} else {
@@ -2086,7 +2086,7 @@ static sr_kemi_xval_t* sr_kemi_pv_get_mode(sip_msg_t *msg, str *pvn,
int rmode)
*/
static sr_kemi_xval_t* sr_kemi_pv_get(sip_msg_t *msg, str *pvn)
{
- return sr_kemi_pv_get_mode(msg, pvn, 0);
+ return sr_kemi_pv_get_mode(msg, pvn, SR_KEMI_XVAL_NULL_NONE);
}
/**
@@ -2094,7 +2094,7 @@ static sr_kemi_xval_t* sr_kemi_pv_get(sip_msg_t *msg, str *pvn)
*/
static sr_kemi_xval_t* sr_kemi_pv_getw(sip_msg_t *msg, str *pvn)
{
- return sr_kemi_pv_get_mode(msg, pvn, 1);
+ return sr_kemi_pv_get_mode(msg, pvn, SR_KEMI_XVAL_NULL_PRINT);
}
/**
@@ -2102,7 +2102,7 @@ static sr_kemi_xval_t* sr_kemi_pv_getw(sip_msg_t *msg, str *pvn)
*/
static sr_kemi_xval_t* sr_kemi_pv_gete(sip_msg_t *msg, str *pvn)
{
- return sr_kemi_pv_get_mode(msg, pvn, 2);
+ return sr_kemi_pv_get_mode(msg, pvn, SR_KEMI_XVAL_NULL_EMPTY);
}
/**
diff --git a/src/core/kemi.h b/src/core/kemi.h
index ef9451b2d5..7824ce2f60 100644
--- a/src/core/kemi.h
+++ b/src/core/kemi.h
@@ -204,6 +204,9 @@ int sr_kemi_ctx_route(sr_kemi_eng_t *keng, run_act_ctx_t *ctx,
sip_msg_t *msg,
sr_kemi_t* sr_kemi_exports_get_pv(void);
+#define SR_KEMI_XVAL_NULL_NONE 0
+#define SR_KEMI_XVAL_NULL_PRINT 1
+#define SR_KEMI_XVAL_NULL_EMPTY 2
void sr_kemi_xval_null(sr_kemi_xval_t *xval, int rmode);
#endif