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 &lt;marwan_sadek@hotmail.com&gt; wrote:<br />&gt; <br />&gt; <br />&gt; <br />&gt; <br />&gt; Hello,<br />&gt; <br />&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; <br />&gt; $var(temp)=$(hdr(WWW-Authenticate){param.value,Realm});<br />&gt; <br />&gt; I also tried it with Digest Realm, Digest and &quot;Digest Realm&quot;.<br />&gt; <br />&gt; The received value in 401 is:<br />&gt; <br />&gt; WWW-Authenticate: Digest realm=&quot;XXXX&quot;,nonce=&quot;5e36af&quot;,qop=&quot;auth&quot;<br />&gt; <br />&gt; I&#39;m getting the following error: parse_params: invalid character, ; expected, found r<br />&gt; <br />&gt; So think the problems happens because there is a space in the parameter name.<br />&gt; <br />&gt; Does anyone know how can I do this?<br />&gt; <br />&gt; Thanks,<br />&gt; Marwan<br />&gt;                                                <br />&gt; <br />&gt; <br />&gt;