Module: kamailio
Branch: master
Commit: 3709b235a56b7c237bafc02ea87fd873e54b4b6d
URL:
https://github.com/kamailio/kamailio/commit/3709b235a56b7c237bafc02ea87fd87…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2019-09-19T10:11:13+02:00
Merge pull request #2068 from kamailio/xavp_serialize_fields
core: fix xavp_serialize_fields
---
Modified: src/core/xavp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3709b235a56b7c237bafc02ea87fd87…
Patch:
https://github.com/kamailio/kamailio/commit/3709b235a56b7c237bafc02ea87fd87…
---
diff --git a/src/core/xavp.c b/src/core/xavp.c
index b3a2654764..e5e33f6e9d 100644
--- a/src/core/xavp.c
+++ b/src/core/xavp.c
@@ -1030,9 +1030,14 @@ int xavp_serialize_fields(str *rname, char *obuf, int olen)
break;
case SR_XTYPE_STR:
LM_DBG(" XAVP str value: %s\n", avp->val.v.s.s);
- ostr.len = snprintf(ostr.s, olen-rlen, "%.*s=%.*s;",
+ if(avp->val.v.s.len == 0) {
+ ostr.len = snprintf(ostr.s, olen-rlen, "%.*s;",
+ avp->name.len, avp->name.s);
+ } else {
+ ostr.len = snprintf(ostr.s, olen-rlen, "%.*s=%.*s;",
avp->name.len, avp->name.s,
avp->val.v.s.len, avp->val.v.s.s);
+ }
if(ostr.len<=0 || ostr.len>=olen-rlen) {
LM_ERR("failed to serialize int value (%d/%d\n",
ostr.len, olen-rlen);