<div dir="ltr"><div>I like dispatcher but i need something more custom to my setup so I want to attempt to emulate some basic behavior of dispatcher.<br></div><div><br></div>I have a simple perl script kamailio calls, it does a database query to get an IP address and port similar to an item listed into the dispatcher list.<div><br></div><div>my question is how do I forward the SIP packet to the destination using the database result query? </div><div><br></div><div>Here is what i have so far but it doesn't work because it's modifying the request uri, where i just want to forward it to the FS server:</div><div><br><div><div>my $sth = $dbh->prepare("SELECT ip_address FROM host_machine WHERE is_online = true ORDER BY random() LIMIT 1");</div><div>$sth->execute();</div><div>my $host_ip_address = $sth->fetchrow();</div><div>Kamailio::log(L_ERR, "Random server: " . $host_ip_address);</div><div>$m->rewrite_ruri('sip:' . $m->pseudoVar('$rU')  . '@' . $host_ip_address . ':5060');<br></div><div>$sth->finish;</div></div></div><div><br></div><div><br></div><div>Thanks!</div><div>/V</div></div>