i didn't used kazoo for testing, but i will be adding a xavp_reset_list() to event
processing (not critical).
test with this script with/without the patch.
have sip client re-register every 30 and you'll see `shm` memory consumption growing
(`xavp_new_value`)
```
...
modparam("usrloc", "xavp_contact", "ulattrs")
modparam("registrar", "xavp_rcd", "ulrcd")
modparam("registrar", "xavp_cfg", "regcfg")
modparam("htable", "htable",
"auth_cache=>size=16;autoexpire=7200;")
modparam("async", "workers", 2)
...
route
{
...
if (is_method("REGISTER")) {
route(REGISTRAR);
exit();
}
...
}
route[REGISTRAR]
{
$xavp(regcfg=>match_received) = $su;
if($sht(auth_cache=>$Au) != $null && registered("location",
"$rz:$Au", 2, 1) == 1) {
xlog("L_INFO", "$ci|register|found cached registration for
$rz:$Au\n");
$var(password) = $sht(auth_cache=>$Au);
route(SAVE_LOCATION);
}
if( !is_present_hf("Authorization")) {
auth_challenge("$fd", "0");
exit();
}
async_route("MY_RESUME", "1");
}
route[MY_RESUME]
{
$xavp(ulattrs=>channel_vars) = '{"channel-vars" : true}';
$xavp(ulattrs=>other_vars) = '{"other-vars" : false}';
route(SAVE_LOCATION);
}
route[SAVE_LOCATION]
{
if ($sht(auth_cache=>$Au) == $null) {
xlog("L_INFO", "$ci|log|caching sip credentials for $Au\n");
};
$sht(auth_cache=>$Au) = $var(password);
$var(save_result) = save("location", "0x04");
if($var(save_result) == -1) {
auth_challenge("$fd", "0");
xlog("L_INFO", "$ci|end|issued auth challenge after failed attempt
to save contact for $Au $si:$sp\n");
exit;
} else {
if($var(save_result) == 1) {
$var(new_reg) = "true";
} else {
$var(new_reg) = "false";
}
}
xlog("L_INFO", "$ci|end|ulattrs $xavp(ulattrs=>channel_vars) ,
$xavp(ulattrs=>other_vars)\n");
xlog("L_INFO", "$ci|end|save result $var(save_result) with with expires
($xavp(ulrcd=>expires)) contact $xavp(ulrcd=>ruid) : $ct\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/pull/1111#issuecomment-301786093