<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<br>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><font style="font-size: 12pt;" color="#333399" face="Courier New, Courier, Monospace" size="3"></font><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Wed, 27 Jun 2012 15:37:42 +0000<br>Subject: Re: [OpenSIPS-Users] WWW-Authenticate header Realm extraction<br>From: duane.larson@gmail.com<br>To: marwan_sadek@hotmail.com<br>CC: users@lists.opensips.org; marwan_sadek@hotmail.com<br><br>I think you can accomplish this by using both of these together<br><br>http://www.opensips.org/Resources/DocsCoreVar18#toc93<br>$hdr(WWW-Authenticate) <br><br>http://www.opensips.org/Resources/DocsCoreTran18#toc6<br>s.select<br><br><br><br><br><br>On , Marwan El-Sadek <marwan_sadek@hotmail.com> 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>></div>                                            </div></body>
</html>