I added new pseudovariale $TMS which gives time in miliseconds. If I print $TMS value it is ok, but when I assign it to avp, it gives strange values.
int pv_get_timenows2(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
{
struct timeval tv;
char buf[30];
str _s;
gettimeofday(&tv, NULL);
unsigned long long msEpoch =
(unsigned long long)(tv.tv_sec) * 1000 +
(unsigned long long)(tv.tv_usec) / 1000;
_s.len = sprintf(buf, "%lld", msEpoch);
_s.s = buf; //<------- I think problem is here
return pv_get_strval(msg, param, res, &_s);
}