Module: kamailio
Branch: master
Commit: a0ef326f4cc8b8463ec58939c20c978f844053b7
URL:
https://github.com/kamailio/kamailio/commit/a0ef326f4cc8b8463ec58939c20c978…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-09-18T09:32:57+02:00
pv: added ocval field for via variables
---
Modified: src/modules/pv/pv_core.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a0ef326f4cc8b8463ec58939c20c978…
Patch:
https://github.com/kamailio/kamailio/commit/a0ef326f4cc8b8463ec58939c20c978…
---
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 4fa8e4677aa..50e1abbd485 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -4509,6 +4509,8 @@ int pv_parse_via_name(pv_spec_p sp, str *in)
sp->pvp.pvn.u.isname.name.n = 5;
else if(strncmp(in->s, "ocseq", 5) == 0)
sp->pvp.pvn.u.isname.name.n = 12;
+ else if(strncmp(in->s, "ocval", 5) == 0)
+ sp->pvp.pvn.u.isname.name.n = 14;
else
goto error;
break;
@@ -4521,6 +4523,8 @@ int pv_parse_via_name(pv_spec_p sp, str *in)
sp->pvp.pvn.u.isname.name.n = 10;
else if(strncmp(in->s, "oc-seq", 6) == 0)
sp->pvp.pvn.u.isname.name.n = 12;
+ else if(strncmp(in->s, "oc-val", 6) == 0)
+ sp->pvp.pvn.u.isname.name.n = 14;
else
goto error;
break;
@@ -4642,6 +4646,13 @@ int pv_get_via_attr(
return pv_get_null(msg, param, res);
}
return pv_get_uintval(msg, param, res, (unsigned long)ocv.seq);
+ case 14: /* oc-val */
+ if(parse_via_oc(msg, vb, &ocv) < 0) {
+ return pv_get_null(msg, param, res);
+ }
+ if(ocv.ocval.s != NULL && ocv.ocval.len > 0) {
+ return pv_get_strval(msg, param, res, &ocv.ocval);
+ }
default:
return pv_get_null(msg, param, res);