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"><<a href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a>></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 <<a href="mailto:marwan_sadek@hotmail.com" target="_blank">marwan_sadek@hotmail.com</a>> wrote:<br>
> <br>> <br>> <br>> <br>> <br></div><div class="im HOEnZb">> Hello Duane,<br>> <br>> Thank you for your reply.<br>> <br>> 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>
> <br>> Regards,<br>> Marwan<br>> <br>> <br>> <br></div><div class="HOEnZb"><div class="h5">> Date: Wed, 27 Jun 2012 15:37:42 +0000<br>> Subject: Re: [OpenSIPS-Users] WWW-Authenticate header Realm extraction<br>
> From: <a href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a><br>> To: <a href="mailto:marwan_sadek@hotmail.com" target="_blank">marwan_sadek@hotmail.com</a><br>> 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>
> <br>> I think you can accomplish this by using both of these together<br>> <br>> <a href="http://www.opensips.org/Resources/DocsCoreVar18#toc93" target="_blank">http://www.opensips.org/Resources/DocsCoreVar18#toc93</a><br>
> $hdr(WWW-Authenticate) <br>> <br>> <a href="http://www.opensips.org/Resources/DocsCoreTran18#toc6" target="_blank">http://www.opensips.org/Resources/DocsCoreTran18#toc6</a><br>> s.select<br>> <br>> <br>
> <br>> <br>> <br>> On , Marwan El-Sadek <a href="mailto:marwan_sadek@hotmail.com" target="_blank">marwan_sadek@hotmail.com</a>> wrote:<br>> > <br>> > <br>> > <br>> > <br>> > Hello,<br>
> > <br>> > I'm trying to extract the Realm value from the WWW-Authenticate header of the 401 unauthorized reply, however, I can't find a pseudo-variable for it, so I tried the following:<br>> > <br>
> > $var(temp)=$(hdr(WWW-Authenticate){param.value,Realm});<br>> > <br>> > I also tried it with Digest Realm, Digest and "Digest Realm".<br>> > <br>> > The received value in 401 is:<br>
> > <br>> > WWW-Authenticate: Digest realm="XXXX",nonce="5e36af",qop="auth"<br>> > <br>> > I'm getting the following error: parse_params: invalid character, ; expected, found r<br>
> > <br>> > So think the problems happens because there is a space in the parameter name.<br>> > <br>> > Does anyone know how can I do this?<br>> > <br>> > Thanks,<br>> > Marwan<br>
> >                                            <br>> > <br>> > <br>> ><br>>                                            <br>> <br>> <br>></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>