<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
On 12/2/10 4:57 PM, Pan B. Christensen wrote:
<blockquote cite="mid:2F3CF754DF1A4EC29230D801CA023708@rtPC"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.6001.18975">
<style></style>
<div><font face="Arial" size="2">Hello,</font></div>
<div> </div>
<div><font face="Arial" size="2">We are running Kamailio 1.5.</font></div>
<div> </div>
<div><font face="Arial" size="2">I'm trying to use the forward()
function with a variable like this:</font></div>
<div><font face="Arial" size="2"> forward($shv(voip1-edge1));</font></div>
<div> </div>
<div><font face="Arial" size="2">That fails to parse.</font></div>
<div><font face="Arial" size="2">I then tried this, which I
thought would fail:</font></div>
<div><font face="Arial" size="2">
<div><font face="Arial" size="2">
forward("$shv(voip1-edge1)");</font></div>
<div> </div>
<div>That parsed correctly, but it then failed to resolve the
domain '<font face="Arial" size="2">$shv(voip1-edge1)' as
expected. Why can this function not use variables?</font></div>
<div> </div>
<div>I tried to make a workaround by doing this:</div>
<div> $du=$ru;<br>
$dd=$shv(voip1-edge1);<br>
forward();<br>
</div>
<div>That also failed. Why is $du writable but $dd is not?</div>
<div> </div>
<div>I then made a fourth attempt, which seems to work:</div>
<div> $du="sip:" + $shv(voip1-edge1);<br>
forward();<br>
</div>
</font></div>
</blockquote>
indeed, the last version is the one that works.<br>
<br>
forward() does not take dynamic parameters, only static string
values. $dd is not writable because is just part of $du which you
can set like you did. $du refers to outbound proxy address
(destination uri) and there matters only host, port and transport,
all the other attributes in $du have no relevance.<br>
<br>
Cheers,<br>
Daniel<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
</body>
</html>