<HTML>
<HEAD>
<TITLE>Re: [OpenSIPS-Users] Extracting a value from a header and assigning it to an AVP</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Ok, I fixed it. I was hitting &nbsp;the condition. My problem was that the other SIP server was adding the value as a string not an integer.<BR>
<BR>
So this worked:<BR>
<BR>
$avp(i:20)=$(hdr(P-Hint){s.int});<BR>
<BR>
<BR>
On 9/28/11 1:41 AM, &quot;Sam Govind&quot; &lt;<a href="govoiper@gmail.com">govoiper@gmail.com</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Print an xlog there, I think it's not hitting this condition ! <BR>
<BR>
On Wed, Sep 28, 2011 at 1:26 AM, Sven Schulz &lt;<a href="svens@psu.edu">svens@psu.edu</a>&gt; wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Lets say for example, another SIP server sends my opensips server a header &#8220;P-Hint: 3&#8221;.<BR>
I would like to extract the value (3) from that header (P-Hint:) and assign it to an AVP.<BR>
How do I do this?<BR>
<BR>
I tried this but it doesn&#8217;t seem to work:<BR>
<BR>
if (is_present_hf(&quot;P-Hint&quot;)) {<BR>
                $avp(i:20)=$(hdr(P-Hint));<BR>
<BR>
_______________________________________________<BR>
Users mailing list<BR>
<a href="Users@lists.opensips.org">Users@lists.opensips.org</a><BR>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
Users mailing list<BR>
<a href="Users@lists.opensips.org">Users@lists.opensips.org</a><BR>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>