Module: kamailio
Branch: master
Commit: 95d61a925959ac8d4c518d34168cdae6570f477a
URL:
https://github.com/kamailio/kamailio/commit/95d61a925959ac8d4c518d34168cdae…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-09-18T08:01:02+02:00
core: parse via - field for oc parameter value
---
Modified: src/core/parser/parse_via.c
Modified: src/core/parser/parse_via.h
---
Diff:
https://github.com/kamailio/kamailio/commit/95d61a925959ac8d4c518d34168cdae…
Patch:
https://github.com/kamailio/kamailio/commit/95d61a925959ac8d4c518d34168cdae…
---
diff --git a/src/core/parser/parse_via.c b/src/core/parser/parse_via.c
index c604f55aa2e..f924e3dc5ee 100644
--- a/src/core/parser/parse_via.c
+++ b/src/core/parser/parse_via.c
@@ -2865,7 +2865,13 @@ int parse_via_oc(struct sip_msg *msg, struct via_body *vbp,
via_oc_t *ocp)
for(vp = vbp->param_lst; vp != NULL; vp = vp->next) {
if(vp->name.len == 2 && strncasecmp(vp->name.s, "oc", 2) == 0)
{
- ocp->oc = 1;
+ if(vp->value.len > 0) {
+ ocp->oc = 2;
+ ocp->ocval.len = vp->value.len;
+ ocp->ocval.s = vp->value.s;
+ } else {
+ ocp->oc = 1;
+ }
} else if(vp->name.len == 7
&& strncasecmp(vp->name.s, "oc-algo", 7) == 0) {
if(vp->value.len > 0) {
diff --git a/src/core/parser/parse_via.h b/src/core/parser/parse_via.h
index d3de9737b68..beda386cf35 100644
--- a/src/core/parser/parse_via.h
+++ b/src/core/parser/parse_via.h
@@ -73,6 +73,7 @@ typedef struct via_param
typedef struct via_oc
{
int oc;
+ str ocval;
str algo;
unsigned long validity;
unsigned int seq;