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

Daniel-Constantin Mierla miconda at gmail.com
Wed Jun 3 11:52:08 CEST 2015


Hello,

update the wiki -- the common use case out there for those values is
lowercase (e.g., in sip uris).

Thanks,
Daniel

On 03/06/15 11:49, Mikko Lehto wrote:
> 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
>

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com




More information about the sr-dev mailing list