<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
to rewrite the r-uri you can use the function for setting PV value:<br>
<br>
sr.pv.sets("$ru", "_here_is_new_uri_");<br>
<br>
To add contact headers to reply, you should use:<br>
<br>
sr.hdr.append_to_reply("Contact: <_here_is_your_uri_>\r\n");<br>
<br>
Cheers,<br>
Daniel<br>
<br>
On 6/20/11 3:23 PM, Sharif Tanvir Rahman wrote:
<blockquote
cite="mid:BANLkTimcdd4F=5qiJ9gYiod5RjTVPYMuGg@mail.gmail.com"
type="cite">
<div dir="ltr"><font face="trebuchet ms,sans-serif">Hello,<br
clear="all">
</font>
<div><font class="Apple-style-span" face="'trebuchet ms',
sans-serif"><br>
</font></div>
<div><font class="Apple-style-span" face="'trebuchet ms',
sans-serif">We plan to use Kamailio as redirect server.
Corresponding contact list is to be fetched by a Lua script
from DB. <br>
</font></div>
<div><br>
</div>
<div>The problem is about calling the required 'rewriteuri'
function:</div>
<div>
<ol>
<li>From lua script. both 'sr.rewriteuri()' and
'sr.modf("rewriteuri", ...)" fails to write the 'contact'
field.</li>
<li>I tried an alternative way; pushing the value from lua
(e.g. sr.pv.sets("contact", <a class="moz-txt-link-rfc2396E" href="sip:...">"sip:..."</a>)) and got the value
in the Kamailio.cfg ($var(contact)). But can't call the
rewriteuri function with this variable's value as
argument. This seems to be a general problem of calling a
function from .cfg with a variable's value as parameter.</li>
</ol>
<div>Any help much appreciated.</div>
</div>
<div><br>
</div>
<div>-- <br>
Sharif <br>
</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://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
</body>
</html>