Module: kamailio
Branch: 5.4
Commit: e1fb94f5c258038527f8f8df90135d6a4c2a4391
URL:
https://github.com/kamailio/kamailio/commit/e1fb94f5c258038527f8f8df90135d6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-07-29T10:45:28+02:00
pv: added missing WS and WSS to $K(key) variable
(cherry picked from commit a8c9d0ae4fbafba89ef12737419037d141eed1d3)
(cherry picked from commit 7b89c5e6abe5f4ae3ee55d9c938c865806f29dec)
---
Modified: src/modules/pv/pv_core.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e1fb94f5c258038527f8f8df90135d6…
Patch:
https://github.com/kamailio/kamailio/commit/e1fb94f5c258038527f8f8df90135d6…
---
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index c07096c240..9bbce87c26 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -3303,6 +3303,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;
@@ -3310,6 +3314,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:
@@ -3381,6 +3387,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);
}