<div dir="ltr"><div><em>Hi all,<br></em><i>&nbsp;I'm trying to&nbsp;register few ata&#39;s to openser.</i></div>
<div><em>i puted two registrations to subscribers table.</em></div>
<div><em>but registaration allwais unauthorized.</em></div>
<div><em></em>&nbsp;</div>
<div><em></em>&nbsp;</div>
<div><em>ngrep output: </em></div>
<div><em>interface: eth0 (<a href="http://192.168.27.0/255.255.255.0">192.168.27.0/255.255.255.0</a>)<br>filter: (ip) and ( port 5060 )</em></div>
<div><em>U <a href="http://192.168.27.117:10186">192.168.27.117:10186</a> -&gt; <a href="http://192.168.27.201:5060">192.168.27.201:5060</a><br>REGISTER sip:<a href="http://192.168.27.201">192.168.27.201</a> SIP/2.0.<br>
Via: SIP/2.0/UDP 192.168.27.117:10186;branch=z9hG4bK645148049;rport.<br>From: &lt;<a href="mailto:sip%3A1000@192.168.27.201">sip:1000@192.168.27.201</a>&gt;;tag=604945105.<br>To: &lt;<a href="mailto:sip%3A1000@192.168.27.201">sip:1000@192.168.27.201</a>&gt;.<br>
Call-ID: <a href="mailto:53873712-10186-1@192.168.27.117">53873712-10186-1@192.168.27.117</a>.<br>CSeq: 2000 REGISTER.<br>Contact: *.<br>Max-Forwards: 70.<br>User-Agent: Grandstream HT-502&nbsp; V1.0B <a href="http://1.0.1.8">1.0.1.8</a>.<br>
Expires: 0.<br>Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE.<br>Content-Length: 0.<br>.</em></div><em>
<div><br>U <a href="http://192.168.27.201:5060">192.168.27.201:5060</a> -&gt; <a href="http://192.168.27.117:10186">192.168.27.117:10186</a><br>SIP/2.0 401 Unauthorized.<br>Via: SIP/2.0/UDP 192.168.27.117:10186;branch=z9hG4bK645148049;rport=10186.<br>
From: &lt;<a href="mailto:sip%3A1000@192.168.27.201">sip:1000@192.168.27.201</a>&gt;;tag=604945105.<br>To: &lt;<a href="mailto:sip%3A1000@192.168.27.201">sip:1000@192.168.27.201</a>&gt;;tag=329cfeaa6ded039da25ff8cbb8668bd2.b963.<br>
Call-ID: <a href="mailto:53873712-10186-1@192.168.27.117">53873712-10186-1@192.168.27.117</a>.<br>CSeq: 2000 REGISTER.<br>WWW-Authenticate: Digest realm=&quot;<a href="http://192.168.27.201">192.168.27.201</a>&quot;, nonce=&quot;48998a3ba4544026eab5a8f7cf93dc258a5d26d7&quot;.<br>
Server: OpenSER (1.3.2-notls (i386/linux)).<br>Content-Length: 0.<br>.<br>U <a href="http://192.168.27.117:10186">192.168.27.117:10186</a> -&gt; <a href="http://192.168.27.201:5060">192.168.27.201:5060</a><br>REGISTER sip:<a href="http://192.168.27.201">192.168.27.201</a> SIP/2.0.<br>
Via: SIP/2.0/UDP 192.168.27.117:10186;branch=z9hG4bK142179605;rport.<br>From: &lt;<a href="mailto:sip%3A1000@192.168.27.201">sip:1000@192.168.27.201</a>&gt;;tag=604945105.<br>To: &lt;<a href="mailto:sip%3A1000@192.168.27.201">sip:1000@192.168.27.201</a>&gt;.<br>
Call-ID: <a href="mailto:53873712-10186-1@192.168.27.117">53873712-10186-1@192.168.27.117</a>.<br>CSeq: 2001 REGISTER.<br>Contact: *.<br>Authorization: Digest username=&quot;1000&quot;, realm=&quot;<a href="http://192.168.27.201">192.168.27.201</a>&quot;, nonce=&quot;48998a3ba4544026eab5a8f7cf93dc258a5d26d7&quot;, uri=&quot;sip:19$<br>
Max-Forwards: 70.<br>User-Agent: Grandstream HT-502&nbsp; V1.0B <a href="http://1.0.1.8">1.0.1.8</a>.<br>Expires: 0.<br>Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE.<br>Content-Length: 0.<br>
.</div>
<div><br>U <a href="http://192.168.27.201:5060">192.168.27.201:5060</a> -&gt; <a href="http://192.168.27.117:10186">192.168.27.117:10186</a><br>SIP/2.0 401 Unauthorized.<br>Via: SIP/2.0/UDP 192.168.27.117:10186;branch=z9hG4bK142179605;rport=10186.<br>
From: &lt;<a href="mailto:sip%3A1000@192.168.27.201">sip:1000@192.168.27.201</a>&gt;;tag=604945105.<br>To: &lt;<a href="mailto:sip%3A1000@192.168.27.201">sip:1000@192.168.27.201</a>&gt;;tag=329cfeaa6ded039da25ff8cbb8668bd2.3c26.<br>
Call-ID: <a href="mailto:53873712-10186-1@192.168.27.117">53873712-10186-1@192.168.27.117</a>.<br>CSeq: 2001 REGISTER.<br>WWW-Authenticate: Digest realm=&quot;<a href="http://192.168.27.201">192.168.27.201</a>&quot;, nonce=&quot;48998a3ba4544026eab5a8f7cf93dc258a5d26d7&quot;.<br>
Server: OpenSER (1.3.2-notls (i386/linux)).<br>Content-Length: 0.<br></div>
<div>&nbsp;</div>
<div>openser.cfg</div>
<div>&nbsp;</div>
<div>:#<br># $Id: openser.cfg 1676 2007-02-21 13:16:34Z bogdan_iancu $<br>#<br># simple quick-start config script<br># Please refer to the Core CookBook at <a href="http://www.openser.org/dokuwiki/doku.php">http://www.openser.org/dokuwiki/doku.php</a><br>
# for a explanation of possible statements, functions and parameters.<br>#</div>
<div># ----------- global configuration parameters ------------------------</div>
<div>debug=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # debug level (cmd line: -dddddddddd)<br>fork=yes<br>log_stderror=no&nbsp;&nbsp;&nbsp; # (cmd line: -E)<br>children=4</div>
<div># Uncomment these lines to enter debugging mode <br>#fork=no<br>#log_stderror=yes<br>#</div>
<div>port=5060<br># ------------------ module loading ----------------------------------</div>
<div>#set module path<br>mpath=&quot;//lib/openser/modules/&quot;</div>
<div># Uncomment this if you want to use SQL database<br>loadmodule &quot;mysql.so&quot;</div>
<div>loadmodule &quot;sl.so&quot;<br>loadmodule &quot;tm.so&quot;<br>loadmodule &quot;rr.so&quot;<br>loadmodule &quot;maxfwd.so&quot;<br>loadmodule &quot;usrloc.so&quot;<br>loadmodule &quot;registrar.so&quot;<br>loadmodule &quot;textops.so&quot;<br>
loadmodule &quot;mi_fifo.so&quot;</div>
<div># Uncomment this if you want digest authentication<br># mysql.so must be loaded !<br>loadmodule &quot;auth.so&quot;<br>loadmodule &quot;auth_db.so&quot;<br># ----------------- setting module-specific parameters ---------------</div>

<div># -- mi_fifo params --</div>
<div>modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/openser_fifo&quot;)</div>
<div># -- usrloc params --</div>
<div>#modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,&nbsp;&nbsp; 0)</div>
<div># Uncomment this if you want to use SQL database<br># for persistent storage and comment the previous line<br>modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 2)</div>
<div># -- auth params --<br># Uncomment if you are using auth module<br>#<br>modparam(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, yes)<br>#<br># If you set &quot;calculate_ha1&quot; parameter to yes (which true in this config),<br>
# uncomment also the following parameter)<br>#<br>modparam(&quot;auth_db&quot;, &quot;password_column&quot;, &quot;password&quot;)</div>
<div># -- rr params --<br># add value to ;lr param to make some broken UAs happy<br>modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)</div>
<div># -------------------------&nbsp; request routing logic -------------------<br># main routing logic</div>
<div>route{</div>
<div>&nbsp;&nbsp;&nbsp; # initial sanity checks -- messages with<br>&nbsp;&nbsp;&nbsp; # max_forwards==0, or excessively long requests<br>&nbsp;&nbsp;&nbsp; if (!mf_process_maxfwd_header(&quot;10&quot;)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; };</div>
<div>&nbsp;&nbsp;&nbsp; if (msg:len &gt;=&nbsp; 2048 ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; };</div>
<div>&nbsp;&nbsp;&nbsp; # we record-route all messages -- to make sure that<br>&nbsp;&nbsp;&nbsp; # subsequent messages will go through our proxy; that&#39;s<br>&nbsp;&nbsp;&nbsp; # particularly good if upstream and downstream entities<br>&nbsp;&nbsp;&nbsp; # use different transport protocol<br>
&nbsp;&nbsp;&nbsp; if (!method==&quot;REGISTER&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; record_route();</div>
<div>&nbsp;&nbsp;&nbsp; # subsequent messages withing a dialog should take the<br>&nbsp;&nbsp;&nbsp; # path determined by record-routing<br>&nbsp;&nbsp;&nbsp; if (loose_route()) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # mark routing logic in request<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: rr-enforced\r\n&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>&nbsp;&nbsp;&nbsp; };</div>
<div>&nbsp;&nbsp;&nbsp; if (!uri==myself) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # mark routing logic in request<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: outbound\r\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # if you have some interdomain connections via TLS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #if(uri=~&quot;@<a href="http://tls_domain1.net">tls_domain1.net</a>&quot;) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay(&quot;tls:<a href="http://domain1.net">domain1.net</a>&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #} else if(uri=~&quot;@<a href="http://tls_domain2.net">tls_domain2.net</a>&quot;) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay(&quot;tls:<a href="http://domain2.net">domain2.net</a>&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>&nbsp;&nbsp;&nbsp; };</div>
<div>&nbsp;&nbsp;&nbsp; # if the request is for other domain use UsrLoc<br>&nbsp;&nbsp;&nbsp; # (in case, it does not work, use the following command<br>&nbsp;&nbsp;&nbsp; # with proper names and addresses in it)<br>&nbsp;&nbsp;&nbsp; if (uri==myself) {</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (method==&quot;REGISTER&quot;) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Uncomment this if you want to use digest.<br>&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp; www_challenge(&quot;&quot;, &quot;0&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save(&quot;location&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!proxy_authorize(&quot;&quot;,&quot;subscriber&quot;)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_challenge(&quot;&quot;,&quot;0&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; consume_credentials();</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup(&quot;aliases&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!uri==myself) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: outbound alias\r\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # native SIP destinations are handled using our USRLOC DB<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!lookup(&quot;location&quot;)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: usrloc applied\r\n&quot;);<br>&nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; route(1);<br>}</div>
<div>route[1] {<br>&nbsp;&nbsp;&nbsp; # send it out now; use stateful forwarding as it works reliably<br>&nbsp;&nbsp;&nbsp; # even for UDP2TCP<br>&nbsp;&nbsp;&nbsp; if (!t_relay()) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_reply_error();<br>&nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; exit;<br>}<br></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>can not understand why this configuration is not working to me???</div>
<div>any help will be apreciated.</div>
<div>&nbsp;</div></em></div>