Module: kamailio
Branch: master
Commit: 3b47b566477baedf687635b2b3f0e2525987e709
URL:
https://github.com/kamailio/kamailio/commit/3b47b566477baedf687635b2b3f0e25…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-11-28T10:20:41+01:00
jansson: rename parameter for janssonmod_get_field()
- more suggestive relation with the meaning of the field name parameter
---
Modified: src/modules/jansson/jansson_funcs.c
Modified: src/modules/jansson/jansson_funcs.h
---
Diff:
https://github.com/kamailio/kamailio/commit/3b47b566477baedf687635b2b3f0e25…
Patch:
https://github.com/kamailio/kamailio/commit/3b47b566477baedf687635b2b3f0e25…
---
diff --git a/src/modules/jansson/jansson_funcs.c b/src/modules/jansson/jansson_funcs.c
index 58a698446ca..dab15d488f3 100644
--- a/src/modules/jansson/jansson_funcs.c
+++ b/src/modules/jansson/jansson_funcs.c
@@ -95,22 +95,22 @@ int janssonmod_get(struct sip_msg *msg, char *path_in, char *src_in,
char *dst)
}
int janssonmod_get_field(
- struct sip_msg *msg, char *path_in, char *src_in, char *dst)
+ struct sip_msg *msg, char *field_in, char *src_in, char *dst)
{
str src_s;
- str path_s;
+ str field_s;
- if(fixup_get_svalue(msg, (gparam_p)src_in, &src_s) != 0) {
- ERR("cannot get json string value\n");
+ if(fixup_get_svalue(msg, (gparam_p)field_in, &field_s) != 0) {
+ ERR("cannot get field name string value\n");
return -1;
}
- if(fixup_get_svalue(msg, (gparam_p)path_in, &path_s) != 0) {
- ERR("cannot get path string value\n");
+ if(fixup_get_svalue(msg, (gparam_p)src_in, &src_s) != 0) {
+ ERR("cannot get json string value\n");
return -1;
}
- return janssonmod_get_helper(msg, &path_s, 1, &src_s, (pv_spec_t *)dst);
+ return janssonmod_get_helper(msg, &field_s, 1, &src_s, (pv_spec_t *)dst);
}
int janssonmod_pv_get(
diff --git a/src/modules/jansson/jansson_funcs.h b/src/modules/jansson/jansson_funcs.h
index ab1c029821f..829aa144c19 100644
--- a/src/modules/jansson/jansson_funcs.h
+++ b/src/modules/jansson/jansson_funcs.h
@@ -28,7 +28,7 @@
int janssonmod_get(
struct sip_msg *msg, char *path_in, char *json_in, char *result);
int janssonmod_get_field(
- struct sip_msg *msg, char *path_in, char *src_in, char *dst);
+ struct sip_msg *msg, char *field_in, char *src_in, char *dst);
int janssonmod_pv_get(
struct sip_msg *msg, char *path_in, char *json_in, char *result);
int janssonmod_set(unsigned int append, struct sip_msg *msg, char *type_in,