[sr-dev] [kamailio/kamailio] IPv6 parse_uri error (#1136)

Donald Carr notifications at github.com
Thu Jun 22 22:46:06 CEST 2017


My opinion is it is better to just change the existing code, and all existing installations will start working with IPv6 when they upgrade. It is also much simpler.

However, the following has been tested and also works to add a $ function that returns a correct IP string for IPv6:

The following would need to be added to the table in modules/pv/pv.c 
        {{"sibr", (sizeof("sibr")-1)}, /* */
                PVT_OTHER, pv_get_srcip_bracket, 0,
                0, 0, 0, 0},

Then a new function in modules/pv/pv.c 
/* The following fundtion gets the source IP with brackets for IPv6  */
int pv_get_srcip_bracket(struct sip_msg *msg, pv_param_t *param,
                pv_value_t *res)
{
        str s;
        if(msg==NULL)
                return -1;

        s.s = ip_addr2strz(&msg->rcv.src_ip);
        s.len = strlen(s.s);
        return pv_get_strval(msg, param, res, &s);
}

Finally, a change to the config file line:
               append_hf("Path: <sip:term at HOSTNAME:"+PORT+";nat=yes;received=sip:$sibr:$sp;$var(ws_transport)lr>\r\n")



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1136#issuecomment-310497694
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20170622/d2e684a3/attachment.html>


More information about the sr-dev mailing list