You can use regex and avp_check:<div><br></div><div><a href="http://www.opensips.org/html/docs/modules/1.8.x/avpops.html#id292733">http://www.opensips.org/html/docs/modules/1.8.x/avpops.html#id292733</a> </div><div><br></div>
<div><br></div><div>Regards,</div><div>Ali Pey</div><div><br><div class="gmail_quote">On Wed, Jun 27, 2012 at 12:06 PM,  <span dir="ltr">&lt;<a href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah.  Yeah that would be a problem.<div class="im HOEnZb"><br><br>On , Marwan El-Sadek &lt;<a href="mailto:marwan_sadek@hotmail.com" target="_blank">marwan_sadek@hotmail.com</a>&gt; wrote:<br>
&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br></div><div class="im HOEnZb">&gt; Hello Duane,<br>&gt; <br>&gt; Thank you for your reply.<br>&gt; <br>&gt; The problem is that the Digest Realm parameter can be at any index in the header, its not always the first parameter. So using the index will not work for all messages!<br>
&gt; <br>&gt; Regards,<br>&gt; Marwan<br>&gt; <br>&gt; <br>&gt; <br></div><div class="HOEnZb"><div class="h5">&gt; Date: Wed, 27 Jun 2012 15:37:42 +0000<br>&gt; Subject: Re: [OpenSIPS-Users] WWW-Authenticate header Realm extraction<br>
&gt; From: <a href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a><br>&gt; To: <a href="mailto:marwan_sadek@hotmail.com" target="_blank">marwan_sadek@hotmail.com</a><br>&gt; CC: <a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>; <a href="mailto:marwan_sadek@hotmail.com" target="_blank">marwan_sadek@hotmail.com</a><br>
&gt; <br>&gt; I think you can accomplish this by using both of these together<br>&gt; <br>&gt; <a href="http://www.opensips.org/Resources/DocsCoreVar18#toc93" target="_blank">http://www.opensips.org/Resources/DocsCoreVar18#toc93</a><br>
&gt; $hdr(WWW-Authenticate) <br>&gt; <br>&gt; <a href="http://www.opensips.org/Resources/DocsCoreTran18#toc6" target="_blank">http://www.opensips.org/Resources/DocsCoreTran18#toc6</a><br>&gt; s.select<br>&gt; <br>&gt; <br>
&gt; <br>&gt; <br>&gt; <br>&gt; On , Marwan El-Sadek <a href="mailto:marwan_sadek@hotmail.com" target="_blank">marwan_sadek@hotmail.com</a>&gt; wrote:<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; Hello,<br>
&gt; &gt; <br>&gt; &gt; I&#39;m trying to extract the Realm value from the WWW-Authenticate header of the 401 unauthorized reply, however, I can&#39;t find a pseudo-variable for it, so I tried the following:<br>&gt; &gt; <br>
&gt; &gt; $var(temp)=$(hdr(WWW-Authenticate){param.value,Realm});<br>&gt; &gt; <br>&gt; &gt; I also tried it with Digest Realm, Digest and &quot;Digest Realm&quot;.<br>&gt; &gt; <br>&gt; &gt; The received value in 401 is:<br>
&gt; &gt; <br>&gt; &gt; WWW-Authenticate: Digest realm=&quot;XXXX&quot;,nonce=&quot;5e36af&quot;,qop=&quot;auth&quot;<br>&gt; &gt; <br>&gt; &gt; I&#39;m getting the following error: parse_params: invalid character, ; expected, found r<br>
&gt; &gt; <br>&gt; &gt; So think the problems happens because there is a space in the parameter name.<br>&gt; &gt; <br>&gt; &gt; Does anyone know how can I do this?<br>&gt; &gt; <br>&gt; &gt; Thanks,<br>&gt; &gt; Marwan<br>
&gt; &gt;                                                <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;<br>&gt;                                                <br>&gt; <br>&gt; <br>&gt;</div></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>