<div dir="ltr">Thanks, Vlad. That's what I ended up doing. Not the most elegant solution; perhaps there could be a join() function added?<div><br></div><div>--</div><div style>Tolga</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Apr 28, 2013 at 10:35 AM, Vlad Paiu <span dir="ltr"><<a href="mailto:vladpaiu@opensips.org" target="_blank">vladpaiu@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>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="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:justify;font-weight:normal;line-height:normal;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica,Arial;word-spacing:0px">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 type="cite"><div><div class="h5">
<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>
And I'm trying to do the equivalent of:</div>
<div><br>
</div>
<div>
<div> avp_pushto("$P-Associated-URI/reply",
"s:uuri/g");</div>
<div><br>
</div>
<div>Which doesn't seem to work anymore (I can only
find reference in old docs).</div>
<div><br>
</div>
<div>Using this:</div>
<div><br>
</div>
<div> append_to_reply("P-Associated-URI:
$avp(uuri)\r\n");</div>
<div><br>
</div>
<div>Only adds one of the AVP values, not all. </div>
<div><br>
</div>
<div>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><br>
</div>
<div>Can anyone point me in the right direction here?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Tolga</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>