[sr-dev] PV $proto in upper or lowercase?

Mikko Lehto mslehto at iki.fi
Wed Jun 3 11:49:32 CEST 2015


Hi

PV cookbook says $proto returns values in uppercase¹,
but I am getting lower case values back.


PV module uses pv_get_proto() in pv_export_t structure:
---
static pv_export_t mod_pvs[] = {
.
.
.
   {{"proto", (sizeof("proto")-1)},
                PVT_OTHER, pv_get_proto, 0, 0, 0, 0, 0},
---

Further on, 3rd parameter (vtype) in call to get_valid_proto()²
asks for lowercase results:
---
int pv_get_proto(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
.
.
.
if (get_valid_proto_string(msg->rcv.proto, 0, 0, &s)<0) {
---


Should I update PV module or cookbook?

I am running 4.2 from git:
---
version: kamailio 4.2.4 (x86_64/linux) a23331
---


[1] UDP, TCP, TLS, SCTP, WS, WSS
http://kamailio.org/wiki/cookbooks/devel/pseudovariables#pr_-_protocol_of_received_message

[2] https://github.com/kamailio/kamailio/blob/master/modules/pv/pv_core.c#L1080

-- 
Mikko Lehto



More information about the sr-dev mailing list