<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hello,<br>
<br>
The avp_pushto function is kind of limited in functionality, since
the 1st param ( the destination ) can only be one of the following<br>
<em style="color: rgb(0, 0, 0); font-family: Helvetica,
Arial; font-size: 12px; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
auto; text-align: justify; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">destination = '$ru'
['/'('username'|'domain')] | '$du' | '$br'<br>
<br>
<br>
</em>The script gives you more flexibility. You can do something
like :<br>
$var(i) = 0;<br>
$avp(result) = "";<br>
while ($(avp(uuri)[$var(i)]) != NULL) {<br>
$avp(result) = $avp(result) +
$(avp(uuri)[$var(i)]) + ",";<br>
$var(i) = $var(i) + 1;<br>
}<br>
<br>
<br>
The $avp(result) will now contain all the values of $avp(test),
sepparated by commas.<br>
Then, in order to add that info to a Header in the reply, you can
call :<br>
append_to_reply("P-Associated-URI: $avp(result) \r\n");<br>
<br>
Best Regards,<br>
Vlad<br>
<br>
Pe 4/27/2013 7:12 AM, Tolga Tarhan a scris:<br>
</div>
<blockquote
cite="mid:CAM3QAwQE1aQ-RorXerQA4kvKqxqe7nuub1BHmGcprF=BZqqZ0w@mail.gmail.com"
type="cite">
<div dir="ltr">I have an AVP with multiple entires which I'd like
to add to a header, but I can't for the life of me find a way to
do this. It looks like once upon a time, avp_pushto could do
this, but not anymore.
<div>
<br>
</div>
<div>Basically, I load an AVP like this:</div>
<div>
<div><br>
</div>
<div> avp_db_load("$avp(userid)/uuid",
"$avp(uuri)/$uuri", "1");</div>
</div>
<div><br>
</div>
<div style="">
And I'm trying to do the equivalent of:</div>
<div style=""><br>
</div>
<div style="">
<div> avp_pushto("$P-Associated-URI/reply",
"s:uuri/g");</div>
<div><br>
</div>
<div style="">Which doesn't seem to work anymore (I can only
find reference in old docs).</div>
<div style=""><br>
</div>
<div style="">Using this:</div>
<div style=""><br>
</div>
<div> append_to_reply("P-Associated-URI:
$avp(uuri)\r\n");</div>
<div><br>
</div>
<div style="">Only adds one of the AVP values, not all. </div>
<div style=""><br>
</div>
<div style="">The way I see it, there are two ways this could
work. Either, I need some way to "join" all the AVP values
into one new string, or I need a way to add a header and
have it take all the values and auto-join them in the usual
SIP way (with comas).</div>
<div style=""><br>
</div>
<div style="">Can anyone point me in the right direction here?</div>
<div style=""><br>
</div>
<div style="">Thanks,</div>
<div style="">Tolga</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>