my $sth = $dbh->prepare("SELECT ip_address FROM host_machine WHERE is_online = true ORDER BY random() LIMIT 1");
$sth->execute();
my $host_ip_address = $sth->fetchrow();
Kamailio::log(L_ERR, "Random server: " . $host_ip_address);
$m->rewrite_ruri('sip:' . $m->pseudoVar('$rU') . '@' . $host_ip_address . ':5060');
$sth->finish;