Yeah you can do this. You should really review the wiki for such questions, it's all there :)<div><br></div><div>Try the select transformation:</div><div><a href="http://www.opensips.org/Resources/DocsCoreTran15#toc6">http://www.opensips.org/Resources/DocsCoreTran15#toc6</a></div>
<div><br></div><div><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: 'Trebuchet MS'; line-height: 21px; "><pre class="escaped" style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier; line-height: 1.2em; margin-top: 0px; margin-bottom: 0px; padding-top: 6px; padding-right: 6px; padding-bottom: 6px; padding-left: 6px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(235, 235, 235); border-right-color: rgb(235, 235, 235); border-bottom-color: rgb(235, 235, 235); border-left-color: rgb(235, 235, 235); background-color: rgb(251, 254, 250); ">
$var(x) = "12,34,56";
$(var(x){s.select,1,,}) => "34" ;</pre></span><div><br></div><div><br></div>So you can:</div><div>$avp(s:parseablestring)='1.2.3.4_9.8.7.6';</div><div>$avp(s:gateway)=$(avp(s:parseablestring){s.select,1,_});</div>
<div><br></div><div>now $avp(s:gateway) = 9.8.7.6; # Note: 0 is the first field, not 1</div><div><br></div><div>And yes, very cool. :)</div><div><br></div><div>-Brett</div><div><br></div><div><div class="gmail_quote">On Fri, Jun 12, 2009 at 9:38 AM, Uwe Kastens <span dir="ltr"><<a href="mailto:kiste@kiste.org">kiste@kiste.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
Thanks, this is very cool.<br>
<br>
Is there a way to split one avp without perl in a handfull of differnt<br>
avps or is better to work with different header files?<br>
<br>
Maybe some more background to that question. My pstn gw should send some<br>
information for later usage in routing etc.pp. (main number and ddi<br>
number, in which place should the number with ddi be sent to the UA).<br>
So I was wondering if I use one header and split the variables on the<br>
opensips or let the pstn gw insert more than one header field (if<br>
needed). ATM I would prefer to work with different headers.<br>
<br>
BR<br>
<br>
Uwe<br>
<br>
<br>
Jeff Pyle schrieb:<br>
<div class="im">> Generically, avp(s:oneavp) = $hdr(SIP-Header)<br>
><br>
> String translations also work here, such as:<br>
> $avp(s:oneavp) = $(hdr(P-Charge-Info){uri.user})<br>
><br>
><br>
><br>
> - Jeff<br>
><br>
><br>
><br>
> On 6/12/09 9:49 AM, "Uwe Kastens" <<a href="mailto:kiste@kiste.org">kiste@kiste.org</a>> wrote:<br>
><br>
>> Hi,<br>
>><br>
>> How can I put the value of a header field in one AVP?<br>
>><br>
>> BR<br>
>><br>
>> Uwe<br>
><br>
><br>
<br>
<br>
</div>--<br>
<div class="im"><br>
kiste lat: 54.322684, lon: 10.13586<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">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>
</div></div></blockquote></div><br></div>