Thank you very much Bogdan, it works fine !<br><br>
<div><span class="gmail_quote">2008/4/25, Bogdan-Andrei Iancu &lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Eric,<br><br>You should try to use proxy_auth() and proxy_challenge() for the SUBSCRIBE....<br><br>Regards,<br>
Bogdan<br><br>Eric PTAK wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px; BORDER-LEFT: #ccc 1px solid"><span class="q">Hi list !<br>&nbsp;I&#39;m building an agent and currently working on Digest authentication using auth and auth_db modules.<br>
I&#39;m trying to authenticate all requests for compliance test purpose.<br>It works fine with REGISTER but I can&#39;t authenticate for others methods like SUBSCRIBE, the module is looping authentication.<br>&nbsp;This is a part of my config file :<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (uri==myself) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!www_authorize(&quot;&quot;, &quot;subscriber&quot;)) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;www_challenge(&quot;&quot;, &quot;0&quot;);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;};<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// others things<br>&nbsp; &nbsp; &nbsp; &nbsp;};<br>&nbsp;And this is the requests / responses :<br>&nbsp;<br>REGISTER sip:sip.awl.test SIP/2.0<br></span>Call-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:0f13c7c272f62943f2f6345c07249fcd@10.24.238.150" target="_blank">0f13c7c272f62943f2f6345c07249fcd@10.24.238.150</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:0f13c7c272f62943f2f6345c07249fcd@10.24.238.150" target="_blank">0f13c7c272f62943f2f6345c07249fcd@10.24.238.150</a>&gt;<span class="q"><br>
CSeq: 1 REGISTER<br>From: &lt;sip:0000@sip.awl.test&gt;;tag=9c0477b2<br>To: &lt;sip:0000@sip.awl.test&gt;<br>Via: SIP/2.0/UDP 10.24.238.150:23456;branch=z9hG4bKb71ee89041bd9f3631cf46a8fc76b46c<br>Max-Forwards: 70<br>Contact: &lt;sip:0000@10.24.238.150:23456;transport=tcp&gt;;expires=3600,&lt;sip:0000@10.24.238.150:23456;transport=udp&gt;;expires=3600<br>
Content-Length: 0<br><br>SIP/2.0 401 Unauthorized<br></span>Call-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:0f13c7c272f62943f2f6345c07249fcd@10.24.238.150" target="_blank">0f13c7c272f62943f2f6345c07249fcd@10.24.238.150</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:0f13c7c272f62943f2f6345c07249fcd@10.24.238.150" target="_blank">0f13c7c272f62943f2f6345c07249fcd@10.24.238.150</a>&gt;<span class="q"><br>
CSeq: 1 REGISTER<br>From: &lt;sip:0000@sip.awl.test&gt;;tag=9c0477b2<br>To: &lt;sip:0000@sip.awl.test&gt;;tag=329cfeaa6ded039da25ff8cbb8668bd2.8696<br>Via: SIP/2.0/UDP 10.24.238.150:23456;branch=z9hG4bKb71ee89041bd9f3631cf46a8fc76b46c<br>
WWW-Authenticate: Digest realm=&quot;sip.awl.test&quot;, nonce=&quot;4811de4caf098eb6f25ea5db9a788578a2d4be35&quot;<br>Server: OpenSER (1.3.1-notls (i386/linux))<br>Content-Length: 0<br><br>REGISTER sip:sip.awl.test SIP/2.0<br>
</span>Call-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:0f13c7c272f62943f2f6345c07249fcd@10.24.238.150" target="_blank">0f13c7c272f62943f2f6345c07249fcd@10.24.238.150</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:0f13c7c272f62943f2f6345c07249fcd@10.24.238.150" target="_blank">0f13c7c272f62943f2f6345c07249fcd@10.24.238.150</a>&gt;<span class="q"><br>
CSeq: 2 REGISTER<br>From: &lt;sip:0000@sip.awl.test&gt;;tag=9c0477b2<br>To: &lt;sip:0000@sip.awl.test&gt;;tag=329cfeaa6ded039da25ff8cbb8668bd2.8696<br>Max-Forwards: 70<br>Contact: &lt;sip:0000@10.24.238.150:23456;transport=tcp&gt;;expires=3600,&lt;sip:0000@10.24.238.150:23456;transport=udp&gt;;expires=3600<br>
Via: SIP/2.0/UDP 10.24.238.150:23456;branch=z9hG4bK4bff3e93bf1dc502db28c4d414e60b4f<br>Authorization: Digest response=&quot;efb87138e6340d7a80a1f13ef26821da&quot;,username=&quot;0000&quot;,realm=&quot;sip.awl.test&quot;,nonce=&quot;4811de4caf098eb6f25ea5db9a788578a2d4be35&quot;,uri=&quot;sip:sip.awl.test&quot;,algorithm=MD5<br>
Content-Length: 0<br><br>SIP/2.0 200 OK<br></span>Call-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:0f13c7c272f62943f2f6345c07249fcd@10.24.238.150" target="_blank">0f13c7c272f62943f2f6345c07249fcd@10.24.238.150</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:0f13c7c272f62943f2f6345c07249fcd@10.24.238.150" target="_blank">0f13c7c272f62943f2f6345c07249fcd@10.24.238.150</a>&gt;<span class="q"><br>
CSeq: 2 REGISTER<br>From: &lt;sip:0000@sip.awl.test&gt;;tag=9c0477b2<br>To: &lt;sip:0000@sip.awl.test&gt;;tag=329cfeaa6ded039da25ff8cbb8668bd2.8696<br>Via: SIP/2.0/UDP 10.24.238.150:23456;branch=z9hG4bK4bff3e93bf1dc502db28c4d414e60b4f<br>
Contact: &lt;sip:0000@10.24.238.150:23456;transport=udp&gt;;expires=3600, &lt;sip:0000@10.24.238.150:23456;transport=tcp&gt;;expires=3600<br>Server: OpenSER (1.3.1-notls (i386/linux))<br>Content-Length: 0<br><br>SUBSCRIBE sip:0000@sip.awl.test SIP/2.0<br>
</span>Call-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:d27f913809ccfa308b497ce92c3d01ef@10.24.238.150" target="_blank">d27f913809ccfa308b497ce92c3d01ef@10.24.238.150</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:d27f913809ccfa308b497ce92c3d01ef@10.24.238.150" target="_blank">d27f913809ccfa308b497ce92c3d01ef@10.24.238.150</a>&gt;<span class="q"><br>
CSeq: 1 SUBSCRIBE<br>From: &lt;sip:0000@sip.awl.test&gt;;tag=3b68764f<br>To: &lt;sip:0000@sip.awl.test&gt;<br>Via: SIP/2.0/UDP 10.24.238.150:23456;branch=z9hG4bKae0ab5a2b4dd462eb139276b814b413c<br>Max-Forwards: 70<br></span>Contact: &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://sip:0000@10.24.238.150:23456/" target="_blank">sip:0000@10.24.238.150:23456</a> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://sip:0000@10.24.238.150:23456/" target="_blank">http://sip:0000@10.24.238.150:23456</a>&gt;&gt;<span class="q"><br>
Expires: 3600<br>Event: presence.winfo<br>Content-Length: 0<br><br>SIP/2.0 401 Unauthorized<br></span>Call-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:d27f913809ccfa308b497ce92c3d01ef@10.24.238.150" target="_blank">d27f913809ccfa308b497ce92c3d01ef@10.24.238.150</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:d27f913809ccfa308b497ce92c3d01ef@10.24.238.150" target="_blank">d27f913809ccfa308b497ce92c3d01ef@10.24.238.150</a>&gt;<span class="q"><br>
CSeq: 1 SUBSCRIBE<br>From: &lt;sip:0000@sip.awl.test&gt;;tag=3b68764f<br>To: &lt;sip:0000@sip.awl.test&gt;;tag=329cfeaa6ded039da25ff8cbb8668bd2.78ff<br>Via: SIP/2.0/UDP 10.24.238.150:23456;branch=z9hG4bKae0ab5a2b4dd462eb139276b814b413c<br>
WWW-Authenticate: Digest realm=&quot;sip.awl.test&quot;, nonce=&quot;4811de4caf098eb6f25ea5db9a788578a2d4be35&quot;<br>Server: OpenSER (1.3.1-notls (i386/linux))<br>Content-Length: 0<br><br>SUBSCRIBE sip:0000@sip.awl.test SIP/2.0<br>
</span>Call-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:d27f913809ccfa308b497ce92c3d01ef@10.24.238.150" target="_blank">d27f913809ccfa308b497ce92c3d01ef@10.24.238.150</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:d27f913809ccfa308b497ce92c3d01ef@10.24.238.150" target="_blank">d27f913809ccfa308b497ce92c3d01ef@10.24.238.150</a>&gt;<span class="q"><br>
CSeq: 2 SUBSCRIBE<br>From: &lt;sip:0000@sip.awl.test&gt;;tag=3b68764f<br>To: &lt;sip:0000@sip.awl.test&gt;;tag=329cfeaa6ded039da25ff8cbb8668bd2.78ff<br>Max-Forwards: 70<br></span>Contact: &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://sip:0000@10.24.238.150:23456/" target="_blank">sip:0000@10.24.238.150:23456</a> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://sip:0000@10.24.238.150:23456/" target="_blank">http://sip:0000@10.24.238.150:23456</a>&gt;&gt;<span class="q"><br>
Expires: 3600<br>Event: presence.winfo<br>Via: SIP/2.0/UDP 10.24.238.150:23456;branch=z9hG4bK0afcac1c88fce00c3bfca270ed379ee4<br>Authorization: Digest response=&quot;efb87138e6340d7a80a1f13ef26821da&quot;,username=&quot;0000&quot;,realm=&quot;sip.awl.test&quot;,nonce=&quot;4811de4caf098eb6f25ea5db9a788578a2d4be35&quot;,uri=&quot;sip:sip.awl.test&quot;,algorithm=MD5<br>
Content-Length: 0<br><br>SIP/2.0 401 Unauthorized<br></span>Call-ID: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:d27f913809ccfa308b497ce92c3d01ef@10.24.238.150" target="_blank">d27f913809ccfa308b497ce92c3d01ef@10.24.238.150</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:d27f913809ccfa308b497ce92c3d01ef@10.24.238.150" target="_blank">d27f913809ccfa308b497ce92c3d01ef@10.24.238.150</a>&gt;<span class="q"><br>
CSeq: 2 SUBSCRIBE<br>From: &lt;sip:0000@sip.awl.test&gt;;tag=3b68764f<br>To: &lt;sip:0000@sip.awl.test&gt;;tag=329cfeaa6ded039da25ff8cbb8668bd2.78ff<br>Via: SIP/2.0/UDP 10.24.238.150:23456;branch=z9hG4bK0afcac1c88fce00c3bfca270ed379ee4<br>
WWW-Authenticate: Digest realm=&quot;sip.awl.test&quot;, nonce=&quot;4811de4caf098eb6f25ea5db9a788578a2d4be35&quot;<br>Server: OpenSER (1.3.1-notls (i386/linux))<br>Content-Length: 0<br><br>&nbsp;<br>&nbsp;<br>As you can see, auth module always use nonce=&quot;4811de4caf098eb6f25ea5db9a788578a2d4be35&quot; in its responses, for both register and subscribe.<br>
<br>thanks for your help,<br><br>Eric.<br><br></span>------------------------------------------------------------------------<br><br>_______________________________________________<br>Users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Users@lists.openser.org" target="_blank">Users@lists.openser.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>&nbsp;<br></blockquote><br>
</blockquote></div><br>