Module: kamailio
Branch: master
Commit: a8c9d0ae4fbafba89ef12737419037d141eed1d3
URL:
https://github.com/kamailio/kamailio/commit/a8c9d0ae4fbafba89ef12737419037d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-06-09T12:15:38+02:00
pv: added missing WS and WSS to $K(key) variable
---
Modified: src/modules/pv/pv_core.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a8c9d0ae4fbafba89ef12737419037d…
Patch:
https://github.com/kamailio/kamailio/commit/a8c9d0ae4fbafba89ef12737419037d…
---
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index a4bfe21985..0af3e640cd 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -3628,6 +3628,10 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
switch(in->len)
{
+ case 2:
+ if(strncmp(in->s, "WS", 2)==0)
+ sp->pvp.pvn.u.isname.name.n = 6;
+ else goto error;
case 3:
if(strncmp(in->s, "UDP", 3)==0)
sp->pvp.pvn.u.isname.name.n = 2;
@@ -3635,6 +3639,8 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
sp->pvp.pvn.u.isname.name.n = 3;
else if(strncmp(in->s, "TLS", 3)==0)
sp->pvp.pvn.u.isname.name.n = 4;
+ else if(strncmp(in->s, "WSS", 3)==0)
+ sp->pvp.pvn.u.isname.name.n = 7;
else goto error;
break;
case 4:
@@ -3706,6 +3712,10 @@ int pv_get_K(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
return pv_get_uintval(msg, param, res, PROTO_TLS);
case 5:
return pv_get_uintval(msg, param, res, PROTO_SCTP);
+ case 6:
+ return pv_get_uintval(msg, param, res, PROTO_WS);
+ case 7:
+ return pv_get_uintval(msg, param, res, PROTO_WSS);
default:
return pv_get_uintval(msg, param, res, AF_INET);
}