...bcalls is the name of the htable, for each dialog I save the callid, from_tag and to_tag (needed params for dialog termination)..
event_route[dialog:start] {
if ($sht(bcalls=>$fU::callid) != $null) {
jsonrpc_exec('{"jsonrpc": "2.0","method": "dlg.terminate_dlg","params": ["$sht(bcalls=>$fU::callid)", "$sht(bcalls=>$fU::from_tag)", "$sht(bcalls=>$fU::to_tag)"],"id": 1}'); <<<<< This is what I think is messy...
xlog("L_NOTICE", "User check: Previous call terminated: $jsonrpl(body)\n");
$sht(bcalls=>$fU::callid) = $dlg(callid);
$sht(bcalls=>$fU::from_tag) = $dlg(from_tag);
$sht(bcalls=>$fU::to_tag) = $tt;
xlog("L_NOTICE", "User check: Updated call-info for $fU in htable\n");
} else {
$sht(bcalls=>$fU::callid) = $dlg(callid);
$sht(bcalls=>$fU::from_tag) = $dlg(from_tag);
$sht(bcalls=>$fU::to_tag) = $tt;
xlog("L_NOTICE", "User check: Added call-info for $fU to htable\n");
}
}