Hi, based on Daniels example from:
http://blog.miconda.eu/2010/01/best-of-new-in-kamailio-300-19-htable.html...
modparam("htable", "htable", "acalls=>size=8;")
...
route {
...
if(is_method("INVITE") && !has_totag())
{
# a new call
if($shtcv(ht=>^$fU$)>=3)
{
send_reply("403", "limit exceeded");
exit;
}
$sht(acalls=>$ci) = $fU;
t_on_failure("NEW_INVITE");
}
if(is_method("BYE"))
{
$sht(acalls=>$ci) = $null;
}
...
}
failure_route[NEW_INVITE] {
$sht(acalls=>$ci) = $null;
}
I use this htable variant to share data between two dialogs (store Contact from one dialog, and re-write other R-URI with it). Referenced by call-id:
...
$avp(referenceID) = $ci + "-" + $avp(direction);
$sht(a=>$avp(referenceID)) = $ct;
...
...