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@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, view it on GitHub, or mute the thread.