<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
I don't know if perl embedded api has the option to set the dst_uri
(the equivalent of $du config variable).<br>
<br>
If not, set the new uri in an avp and in kamailio.cfg, after
executing your perl script, do:<br>
<br>
$du = $avp(urifromperl);<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 15/09/14 19:17, Vik Killa wrote:<br>
</div>
<blockquote
cite="mid:CAC-LwPOnQjgczkxGirffyROzaXHH4r2-iNKhhNZD53TMWj9=ug@mail.gmail.com"
type="cite">
<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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Next Kamailio Advanced Trainings 2014 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Sep 22-25, Berlin, Germany</pre>
</body>
</html>