[asterisk-bugs] [Asterisk 0013861]: ERROR[23999]: res_config_ldap.c:1292 update_ldap: Couldn't modify ... Undefined attribute type

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jan 9 23:10:38 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13861 
====================================================================== 
Reported By:                scramatte
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13861
Category:                   Resources/res_config_ldap
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0.1 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-11-07 11:24 CST
Last Modified:              2009-01-09 23:10 CST
====================================================================== 
Summary:                    ERROR[23999]: res_config_ldap.c:1292 update_ldap:
Couldn't modify   ...  Undefined attribute type
Description: 
my Asterisk return me this error on SIP register :

ERROR[23999]: res_config_ldap.c:1292 update_ldap: Couldn't modify
dn:cn=200,ou=Telephony,dc=example,dc=com because Undefined attribute type

In spite of this message I can call and receive calls.

I haven't got more details ... 
I've run Asterisk  with  -vvvvvvvvvvvvvvvvgc    


====================================================================== 

---------------------------------------------------------------------- 
 (0097414) jcovert (reporter) - 2009-01-09 23:10
 http://bugs.digium.com/view.php?id=13861#c97414 
---------------------------------------------------------------------- 
Well, it looks like I am in the process of becoming an LDAP expert, since I
have a client paying me to make SIP LDAP work.

What's going on here is that when a register comes in, Asterisk wants to
put some info back into LDAP:
 Modifying name=user1 hits: 1
 ipaddr=n.n.n.54 
 AstAccountPort=5060 
 AstAccountExpirationTimestamp=1231559723 
 defaultuser=user1

Well, of these 5 fields, "name" is ok, and the two "Ast..." guys are ok,
but neither ipaddr nor defaultuser are any good.

This is being done from chan_sip.c, which has:
  ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
                        "port", port, "regseconds", regseconds,
                        deprecated_username ? "username" : "defaultuser",
                        defaultuser, fc, fullcontact, syslabel, sysname,
NULL);

The clue to the way to deal with this is noticing that "port" from the SIP
call turned into AstAccountPort in the ldap update.  Ahah!  So we go and
look at res_ldap.conf.  We surely don't want to change AstAccountHost from
dynamic to the ipaddr, so I'll stick it into AstConfigCommented, and
defaultuser can go into AstAccountDefaultUser.

And BINGO:  No more ugly message.  Now, right after a register, we have:

dn: cn=user1,ou=sippeers,dc=covert,dc=org
objectClass: top
objectClass: AsteriskSIPUser
cn: user1
AstAccountCallerID: User 1 <2001>
AstAccountHost: dynamic
AstAccountContext: ldapuser
name: user1
AstConfigCommented: x.x.x.54
AstAccountPort: 5060
AstAccountExpirationTimestamp: 1231562656
AstAccountDefaultUser: user1

And after an unregister, we have:

dn: cn=user1,ou=sippeers,dc=covert,dc=org
objectClass: top
objectClass: AsteriskSIPUser
cn: user1
AstAccountCallerID: User 1 <2001>
AstAccountHost: dynamic
AstAccountContext: ldapuser
name: user1
AstConfigCommented: 0.0.0.0
AstAccountPort: 0
AstAccountExpirationTimestamp: 1231562710
AstAccountDefaultUser: user1


To review how we got here, I had to make the following changes to
res_ldap.conf:
1. right under [sip] change "uid" to "cn" because the schema requires cn
and doesn't allow uid.
2. Near the end of this section, add
ipaddr = AstConfigCommented
defaultuser = AstAccountDefaultUser
3. Change the additional filter to be
additionalFilter=(objectClass=AsteriskSIPUser)
because what was there before didn't match the schema.

And voila!  It all works, in and out.  Missing, unfortunately, is a way to
show, from the CLI, all these LDAP peers that are currently registered.

Could someone maybe commit the necessary changes to res_ldap.conf?

/john 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-09 23:10 jcovert        Note Added: 0097414                          
======================================================================




More information about the asterisk-bugs mailing list