<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'>
Hello Ali,<div><br></div><div>I don't know how can I do that with avp_check! I need to extract only the realm part value to use it elsewhere!</div><div><br></div><div>Regards,</div><div>Marwan<br><font face="Courier New, Courier, Monospace" color="#333399" size="3"></font><br>-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div><div><pre>You can use regex and avp_check:

<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>


Regards,
Ali Pey</pre></div><br><font face="Courier New, Courier, Monospace" color="#333399" size="3"></font><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Wed, 27 Jun 2012 16:06:52 +0000<br>Subject: Re: RE: [OpenSIPS-Users] WWW-Authenticate header Realm extraction<br>From: duane.larson@gmail.com<br>To: marwan_sadek@hotmail.com; duane.larson@gmail.com<br>CC: users@lists.opensips.org; marwan_sadek@hotmail.com<br><br>Ah.  Yeah that would be a problem.<br><br>On , Marwan El-Sadek &lt;marwan_sadek@hotmail.com&gt; wrote:<br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&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>&gt; Date: Wed, 27 Jun 2012 15:37:42 +0000<br>&gt; Subject: Re: [OpenSIPS-Users] WWW-Authenticate header Realm extraction<br>&gt; From: duane.larson@gmail.com<br>&gt; To: marwan_sadek@hotmail.com<br>&gt; CC: users@lists.opensips.org; marwan_sadek@hotmail.com<br>&gt; <br>&gt; I think you can accomplish this by using both of these together<br>&gt; <br>&gt; http://www.opensips.org/Resources/DocsCoreVar18#toc93<br>&gt; $hdr(WWW-Authenticate) <br>&gt; <br>&gt; http://www.opensips.org/Resources/DocsCoreTran18#toc6<br>&gt; s.select<br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; On , Marwan El-Sadek marwan_sadek@hotmail.com&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'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>&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 "Digest Realm".<br>&gt; &gt; <br>&gt; &gt; The received value in 401 is:<br>&gt; &gt; <br>&gt; &gt; WWW-Authenticate: Digest realm="XXXX",nonce="5e36af",qop="auth"<br>&gt; &gt; <br>&gt; &gt; I'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></body>
</html>