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&#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;