if (is_method("INVITE")) {
sql_query("didrouting_db", "SELECT route_to FROM did_routing WHERE did_number='$rU'", "result");
if ($dbr(result=>rows) > 0) {
$var(route_to) = $dbr(result=>[0,0]);
xlog("L_INFO", "Routing DID $rU to $var(route_to)\n");
$du = "sip:" + $var(route_to) + ":5060";
} else {
$du = "sip:" + FS_IP + ":5060";
}
The above logic works fine for a single IP.
I intend to use a comma-separated list of IPs in my
route_to column (for example 192.168.1.2,192.168.1.3, ...) and then iterate through these IPs one by one. I'm having trouble coming up with a workable logic or loop to achieve this. Would you be able to offer any guidance or suggestions?
Please also recommend if there is a better approach available to handle this scenario.