<style type="text/css">!--
                @page { size: 8.5in 11in; margin: 0.79in }
                P { margin-bottom: 0.08in }
        --&gt;</style>Dear all, 

<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;">I wounder if anyone successfully uses
openSER 1.3.x with LDAP server (openLDAP). For me I work fine with
Authenticating the uses while REGISTER request. However, I could not
configure it to Authenticate call setup. in other words, an non
register user can make a call setup. what comes to my mind is to use
the same idea of authentication when RIGISTER request was issues with
some modefications but when SIP proxy server send "407 Proxy
Authentication Required" the client send ACK and stop. 
</p>
<p style="margin-bottom: 0in;">=================================================<br>
</p>
<p style="margin-bottom: 0in;"># account only INVITEs
</p>
<p style="margin-bottom: 0in;">if (is_method(&quot;INVITE&quot;)) {
</p>
<p style="margin-bottom: 0in;">   xlog(&quot;L_NOTICE&quot;,&quot;Processing
by INVITE handler ...\n&quot;);
</p>
<p style="margin-bottom: 0in;">   route(4);
</p>
<p style="margin-bottom: 0in;">   exit;
</p>
<p style="margin-bottom: 0in;">   #setflag(1); # do accouting
</p>
<p style="margin-bottom: 0in;">}</p>
<p style="margin-bottom: 0in;">.....</p>
<p style="margin-bottom: 0in;">route[1] {
</p>
<p style="margin-bottom: 0in;">        if (!t_relay()) {
</p>
<p style="margin-bottom: 0in;">                sl_reply_error();
</p>
<p style="margin-bottom: 0in;">        };
</p>
<p style="margin-bottom: 0in;">        exit;
</p>
<p style="margin-bottom: 0in;">}</p>
<p style="margin-bottom: 0in;">..........</p>
<p style="margin-bottom: 0in;">
rout[4]</p>
<p style="margin-bottom: 0in;">{</p>
<p style="margin-bottom: 0in;">       
if(is_present_hf(&quot;Authorization&quot;))
</p>
<p style="margin-bottom: 0in;">        {
</p>
<p style="margin-bottom: 0in;">            # ldap search
</p>
<p style="margin-bottom: 0in;">            if
(!ldap_search(&quot;ldap://sipaccounts/ou=sip,dc=mysip,dc=com?sn,userPassword?one?(cn=$fU)&quot;))
</p>
<p style="margin-bottom: 0in;">            {
</p>
<p style="margin-bottom: 0in;">               switch ($retcode)
</p>
<p style="margin-bottom: 0in;">               {
</p>
<p style="margin-bottom: 0in;">                   case -1:
</p>
<p style="margin-bottom: 0in;">                       # no LDAP entry
found
</p>
<p style="margin-bottom: 0in;">                     
sl_send_reply(&quot;404&quot;, &quot;User Not Found&quot;);
</p>
<p style="margin-bottom: 0in;">                     exit;
</p>
<p style="margin-bottom: 0in;">                    case -2:
</p>
<p style="margin-bottom: 0in;">                       # internal
error
</p>
<p style="margin-bottom: 0in;">                      
sl_send_reply(&quot;500&quot;, &quot;Internal server error&quot;);
</p>
<p style="margin-bottom: 0in;">                       exit;
</p>
<p style="margin-bottom: 0in;">                    default:
</p>
<p style="margin-bottom: 0in;">                       exit;
</p>
<p style="margin-bottom: 0in;">                }
</p>
<p style="margin-bottom: 0in;">            }
</p>
<p style="margin-bottom: 0in;">           
ldap_result(&quot;sn/$avp(s:username)&quot;);
</p>
<p style="margin-bottom: 0in;">           
ldap_result(&quot;userPassword/$avp(s:password)&quot;);
</p>
<p style="margin-bottom: 0in;">           
if(!pv_proxy_authorize(&quot;&quot;))
</p>
<p style="margin-bottom: 0in;">            {
</p>
<p style="margin-bottom: 0in;">                
proxy_challenge(&quot;&quot;/*realm*/,&quot;0&quot;/*qop*/);
</p>
<p style="margin-bottom: 0in;">                 exit;
</p>
<p style="margin-bottom: 0in;">            }
</p>
<p style="margin-bottom: 0in;">        route(1);
</p>
<p style="margin-bottom: 0in;">        } else {
</p>
<p style="margin-bottom: 0in;">            proxy_challenge(&quot;&quot;,&quot;1&quot;);
</p>
<p style="margin-bottom: 0in;">            exit;
</p>
<p style="margin-bottom: 0in;">        }</p>
<p style="margin-bottom: 0in;"><br>
</p>

<p style="margin-bottom: 0in;"> 

=================================================<br><br>
</p>
<p style="margin-bottom: 0in;"> do any one know how to authenticate
call setup? do you think using RADIUS is better for authentication
instead of LDAP authentication?</p>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;">regards, 
</p>
<p style="margin-bottom: 0in;">Ahmed ALALI  
</p>
<p style="margin-bottom: 0in;"><br>
</p>