<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18975"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV><FONT size=2 face=Arial>Thanks for your swift reply, Daniel.</FONT></DIV>
<DIV><FONT size=2 face=Arial>I would also like to thank you again for the
great training last week.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>My main question was:</FONT></DIV>
<DIV><FONT size=2 face=Arial>Why does forward() not take dynamic parameters?
Should it not do so (in the future) to be in line with other functions? It was
not difficult to work around, but I think it would be more logical if the
function could use dynamic parameters like all the other functions I've used can
do.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>With kind regards,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Pan</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=miconda@gmail.com href="mailto:miconda@gmail.com">Daniel-Constantin
Mierla</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=pan@ibidium.no
href="mailto:pan@ibidium.no">Pan B. Christensen</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A
title=sr-users@lists.sip-router.org
href="mailto:sr-users@lists.sip-router.org">kamailio</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, December 03, 2010 11:14
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [SR-Users] using forward()
with variables</DIV>
<DIV><FONT size=2 face=Arial></FONT><BR></DIV><BR><BR>On 12/2/10 4:57 PM, Pan
wrote:
<BLOCKQUOTE cite=mid:2F3CF754DF1A4EC29230D801CA023708@rtPC type="cite">
<META name=GENERATOR content="MSHTML 8.00.6001.18975">
<STYLE></STYLE>
<DIV><FONT size=2 face=Arial>Hello,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>We are running Kamailio 1.5.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I'm trying to use the forward() function with a
variable like this:</FONT></DIV>
<DIV><FONT size=2 face=Arial>
forward($shv(voip1-edge1));</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>That fails to parse.</FONT></DIV>
<DIV><FONT size=2 face=Arial>I then tried this, which I thought would
fail:</FONT></DIV>
<DIV><FONT size=2 face=Arial>
<DIV><FONT size=2 face=Arial>
forward("$shv(voip1-edge1)");</FONT></DIV>
<DIV> </DIV>
<DIV>That parsed correctly, but it then failed to resolve the domain '<FONT
size=2 face=Arial>$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></BLOCKQUOTE></BODY></HTML>