[Home]

Summary:ASTERISK-05620: [branch][post 1.4] LDAP Realtime driver
Reporter:Manuel Guesdon (mguesdon)Labels:
Date Opened:2005-11-16 11:11:28.000-0600Date Closed:2008-01-23 07:20:27.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk.schema
( 1) asterisk-v2.schema
( 2) asterisk-v3.1.1.ldif
( 3) asterisk-v3.1.1.schema
( 4) asterisk-v3.1.2.ldif
( 5) asterisk-v3.1.2.schema
( 6) asterisk-v3.1.4.ldif
( 7) asterisk-v3.1.4.schema
( 8) asterisk-v3.1.schema
( 9) asterisk-v3.schema
(10) debug1.txt
(11) patch_res_config_ldap.diff
(12) res_config_ldap_patch_svn_90039.patch
(13) res_config_ldap.c
(14) res_config_ldap.c.0.9
(15) res_config_ldap.c.patch
(16) res_config_ldap.c-svn-diff-50465
(17) res_config_ldap.patch
(18) res_config_ldap.tgz
(19) res_config_ldap-formatting.1.patch
(20) res_config_ldap-v0.7.tar.gz
(21) res_ldap.conf.sample
(22) res_ldap.conf.sample.patch
Description:Here is a ldap realtime driver.
res_config_ldap.c: code
res_ldap.conf.sample: res_ldap.conf sample
asterisk.ldap-schema: example of ldap schema
ldap-patch.diff: Makefile patch

****** ADDITIONAL INFORMATION ******

The latest code is located here http://svn.digium.com/view/asterisk/team/group/res_config_ldap
Comments:By: Olle Johansson (oej) 2005-11-16 11:56:08.000-0600

Questions:
- Which LDAP library are you using?

- The naming seems strange in the schema, why is all names prefixed with oxy?

- Which LDAP server have you tested this with?

- Do we need a README file for this? (Recommended)

By: Manuel Guesdon (mguesdon) 2005-11-16 11:56:29.000-0600

BTW, see also http://bugs.digium.com/view.php?id=5765

By: Manuel Guesdon (mguesdon) 2005-11-16 12:06:37.000-0600

- Which LDAP library are you using?

OpenLDAP libs (http://www.openldap.org)


- The naming seems strange in the schema, why is all names prefixed with oxy?

As it is not standardized, I've done this to avoid naming problems with other people schema. But one can just search/replace the prefix in res_ldap.conf & schema.
I'll make a note on this in the README.


- Which LDAP server have you tested this with?
openldap-2.2.23

- Do we need a README file for this? (Recommended)

Yes, I'll send one this evening. I wanted to publish the thing before someone else spend time  working on this driver (as it occurs with the 3 res_config_pgsql drivers :-)

By: Manuel Guesdon (mguesdon) 2005-11-16 14:31:31.000-0600

Here's a readme file. Fill free to modify it, improve it and correct my bad english :-)

By: Olle Johansson (oej) 2005-11-18 01:07:59.000-0600

I think the config file format has to change. The one-line config is really unpractical and doesn't really follow any used syntax in asterisk.

By: Manuel Guesdon (mguesdon) 2005-11-18 03:01:52.000-0600

I agree it's not really readable.
Do you have ideas on how to do this ?

There's no sub-categories in asterisk config files :-)
May be something like:
[table_name]
attribute=VariableName1=LDAPAttributeName1
attribute=VariableName2=LDAPAttributeName2

or
[table_name]
attribute=VariableName1<->LDAPAttributeName1
attribute=VariableName2<->LDAPAttributeName2

Manuel

By: Mark Spencer (markster) 2005-11-30 10:43:14.000-0600

This is so funny, I was *just* theorizing about something like this yesterday.  For the greatest consistency, i would recommend something like:

[table_name]
attribute=VariableName1,LDAPAttributeName1
attribute=VariableName2,LDAPAttributeName2

By: Mark Spencer (markster) 2005-11-30 11:41:12.000-0600

Or, how about this:

[table_name]
VariableName1 => LDAPAttributeName1
VariableName2 => LDAPAttributeName2

By: Manuel Guesdon (mguesdon) 2005-11-30 12:10:18.000-0600

I'd like to avoid
VariableName1 => LDAPAttributeName1
because there's other parameters.

My last version (not yet uploaded) use the following syntax:

[extensions]
attribute = context  =>  oxyPBXExtensionContext
attribute = exten  =>  oxyPBXExtensionExten
attribute = priority => oxyPBXExtensionPriority
attribute = app => oxyPBXExtensionApplication
attribute = appdata => oxyPBXExtensionApplicationData
additionalFilter=(objectClass=oxyPBXExtension)


What do you think of this ?

Manuel

By: Matt O'Gorman (mogorman) 2006-01-09 13:19:24.000-0600

this patch appears to fail coding guide lines.  However It looked fine to me.  I imagine though you guys to need on config file structure.

By: Manuel Guesdon (mguesdon) 2006-01-10 00:58:33.000-0600

I have some things to fix and I'll fix coding problem.
I hope I can submit a new version in a week or 2.

By: Olle Johansson (oej) 2006-02-22 10:32:20.000-0600

Would be cool to get an update, so I can include this patch in the test branch.

By: Olle Johansson (oej) 2006-03-03 05:51:29.000-0600

Still waiting for an update to this, thanks.

By: Matt O'Gorman (mogorman) 2006-03-07 16:35:42.000-0600

mguesdon any updates?

By: Manuel Guesdon (mguesdon) 2006-03-08 01:44:21.000-0600

Really soon now. I've changed config files and fixed the code and now I fix some ldap schema problem.

By: Manuel Guesdon (mguesdon) 2006-03-08 11:47:51.000-0600

Here is the update !

By: Olle Johansson (oej) 2006-03-08 13:31:27.000-0600

The makefile needs an option to check for a .h file...

By: Olle Johansson (oej) 2006-03-08 13:38:25.000-0600

Included in the "test-this-branch" branch. Good work. Added a check for /usr/include/ldap.h in Makefile. Should propably check for /usr/local/include/ldap.h as well for BSD systems.

By: Olle Johansson (oej) 2006-03-08 15:09:37.000-0600

You really need to clean up the source code for this.
I've created a branch named "res_config_ldap". In that I've

- Added the GPL information and header files needed
- Converted comments to doxygen format

There's still a lot of code commented out, bad formatting and other fixes needed before we can take this further. Read the CODING GUIDELINES in your /doc directory, download the branch, fix it, submit a patch to the branch (not a new .tar.gz) so I can update the branch.

Thanks for contributing this, now let's make it ready for inclusion.

By: Manuel Guesdon (mguesdon) 2006-03-08 16:37:24.000-0600

Could you give me some hints about bad code formatting ? I've done a indent -i4 -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs as read in doc/CODING-GUIDELINES and check if result seems correct...
It's not so easy to work on multiple free projects with differents guidelines :-(

By: Olle Johansson (oej) 2006-03-09 00:45:00.000-0600

Check the difference between the res_config_ldap.c in the branch and yours. I haven't changed all, but changed at least one function to use <tab> indents instead of spaces, changed the curly brackets as well.

Declaration of variables in the middle of code is also something that causes problems on some platforms, they have to be in the start of the block.

Run a diff and you will see.

By: sebb (sebb) 2006-03-17 08:45:48.000-0600

I have a problem using res_config_ldap with voicemail-users from ldap:

when I use it, after choosing the person from the directory and pressing "1" I get an warning and it doesn't dial:

-- Executing Directory("SIP/194.231.228.109-0815c498", "default|nebenstellen-intern") in new stack
 == Parsing '/etc/asterisk/voicemail.conf': Found
   -- Playing 'dir-intro' (language 'en')
   [..]
   -- Playing 'dir-instr' (language 'en')
Mar 16 17:37:59 WARNING[30398]: app_directory.c:203 play_mailbox_owner: Can't find extension '' in context 'nebenstellen-intern'.  Did you pass the wrong context to Directory?


I fixed it in apps/app_directory.c, but I'm not sure if that's the right place or if it's a bug in the res_config_ldap. Everything else (voicemail, voicemailmain, mailboxexists) works fine.

apps/app_directory.c:
- var = ast_variable_new(mailbox, tmp);
+ var = ast_variable_new(ast_variable_retrieve(rtdata, mailbox, "mailbox"), tmp);

My configuration:

res_ldap.conf:
[voicemail]
attribute = mailbox => oxyPBXAccountMailbox
attribute = email => mail
attribute = fullname => cn
attribute = context => oxyPBXVoicemailContext
attribute = password => oxyPBXVoicemailPin
additionalFilter=(objectClass=oxyPBXVoicemail)

extconfig.conf:
voicemail => ldap,"dc=roesner,dc=loc",voicemail

By: sebb (sebb) 2006-03-17 08:49:28.000-0600

Btw, I think it would be great if something like

---
[sippeers]
attribute = host => oxyPBXAccountHost
[..]
attribute = nat => "yes"
attribute = context => "mycontext"
--

would work, that it isn't necessary to define values in the ldap-tree that are the same for every entry.

By: Manuel Guesdon (mguesdon) 2006-03-17 11:14:31.000-0600

About 'common' attributes, you can add an attribute 'oxyPBXAccountBaseDN' in you ldapentries, pointing to a base entry in where you'll set nat,context,... variables.
accountBaseDN is probably not a good name, may be entryBaseDN ?

By: lam (supervga) 2006-04-12 04:38:53

hi...
  i use Asterisk@Home and i want to log in X-Lite or the other SIP phones with user name and password in my LDAP server.
  i have installed res_config_ldap-v0.7.tar.gz but i don't look up file res_ldap.conf  .

  help me.

By: Manuel Guesdon (mguesdon) 2006-04-12 04:53:55

See configs/res_ldap.conf.sample (you have to copy it as /etc/astersik/res_ldap.conf and modify it)

By: lam (supervga) 2006-04-12 21:41:54

thanks mguesdon!
 
  My file ldif as follow :

version: 1

# LDIF Export for: jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
# Generated by phpLDAPadmin on April 13, 2006 9:08 am
# Server: My LDAP Server (192.168.1.2)
# Search Scope: sub
# Total entries: 2

# Entry 1: mail=100@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany...
dn: mail=100@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
mailQuotaCount: 10000
sn: 100
objectClass: top
objectClass: HyMailIspAccount
objectClass: inetOrgPerson
lastChange: 1144393936
mail: 100@myCompany.com
telephoneNumber: 100
mailMessageStore: /var/qmail/maildirs/myCompany.com/100/
givenName: 100
accountStatus: active
mailQuota: 102400000S,10000C
cn: 100
mailQuotaSize: 102400000
deliveryMode: localdelivery
delete: FALSE
homeDirectory: /var/qmail/maildirs/myCompany.com/100/
userPassword: abc123
uid: 100@myCompany.com

# Entry 2: mail=101@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany...
dn: mail=101@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
mailQuotaCount: 10000
sn: 101
objectClass: top
objectClass: HyMailIspAccount
objectClass: inetOrgPerson
lastChange: 1144393955
mail: 101@myCompany.com
telephoneNumber: 101
mailMessageStore: /var/qmail/maildirs/myCompany.com/101/
givenName: 101
accountStatus: active
mailQuota: 102400000S,10000C
cn: 101
mailQuotaSize: 102400000
deliveryMode: localdelivery
delete: FALSE
homeDirectory: /var/qmail/maildirs/myCompany.com/101/
userPassword: {MD5}oUHEeSeSm8LR+20zaiVt9A==
uid: 101@myCompany.com


  Help me modify res_ldap.conf,extconfig.conf,... to log in to SIP phones with the accounts.

Thanks ...!



By: Andrey Solovyev (corruptor) 2006-04-13 06:56:53

mguesdon, thx for great app.
I can't get it working but i think i am close.
My system is Red Hat 9.0, asterisk 1.2.6 compiled with res_config_ldap.

I've made everything according to sample configs.
res_config_ldap succesfully connects to my LDAP db. I see that in asterisk DEBUG.
res_config_ldap.c: LDAP RealTime: bind to localhost as cn=Asterisk,dc=example,dc=com
Apr 13 13:33:39 DEBUG[18378] res_config_ldap.c: LDAP RealTime: Successfully connected to database.

I have only one entry in my db. This is it.
dn: dc=example, dc=com
objectClass: top
objectClass: organization
o: example.com

dn: uid=253, dc=example, dc=com
oxyPBXAccountDTMFMode: rfc2833
oxyPBXAccountContext: from-internal
uid: 253
oxyPBXAccountNAT: never
objectClass: top
objectClass: oxyPBXAccount
objectClass: oxyPBXAccountSIP
oxyPBXAccountCallerID: FromLdap <253>
oxyPBXAccountUserName: 253
oxyPBXAccountSecret: secret

I added oxyPBXAccountSecret attribute to the schema by myself. And i also added line "attribute = secret => oxyPBXAccountSecret" to res_ldap.conf. But that is not the problem. In res_ldap.conf I have [sip] section as it is in sample config.
The problem is with the extconfig.conf. I have only two lines there:
sipusers => ldap,"dc=example,dc=com",sip
sippeers => ldap,"dc=example,dc=com",sip

Somehow the quates aren't recognized and it begins to search for a table 'dc=com"'. In debug log i see:
Apr 13 13:48:13 DEBUG[18388] res_config_ldap.c: LDAP RealTime (806): realtime_ldap: basedn: "dc=example table_name: dc=com"
Apr 13 13:48:13 DEBUG[18388] res_config_ldap.c: LDAP RealTime (581): realtime_ldap_base: basedn: "dc=example table_name: dc=com"
Apr 13 13:48:13 DEBUG[18388] res_config_ldap.c: LDAP RealTime: Everything seems fine.
Apr 13 13:48:13 DEBUG[18388] res_config_ldap.c: LOG Variable: LDAP RealTime: ==> Found Entry
Apr 13 13:48:13 DEBUG[18388] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry"

I also get the WARNING:
Apr 13 13:49:13 WARNING[18388]: res_config_ldap.c:605 realtime_ldap_base: LDAP RealTime: No table named 'dc=com"'.

Then I made the tree with dn "dc=example", so there is no comma. I changed res_ldap.conf:
sipusers => ldap,"dc=example",sip
sippeers => ldap,"dc=example",sip
Now there is no comma in basrDN and that helped.

I've attached the debug info in debug1.txt. It's seen that the entry about sippeer/sipuser has been found. But at the end there is segmentation fault :(. Asterisk crashes.
I've also attached an ldiff which was added to ldap server.

If more info is needed I will provide it. This is my first post here, so I am sorry if I've done something wrong.
Thank you in advance.



By: lam (supervga) 2006-04-14 05:11:09

thanks mguesdon !

 My file ldif as follow :

version: 1

# LDIF Export for: jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
# Generated by phpLDAPadmin on April 13, 2006 9:08 am
# Server: My LDAP Server (192.168.1.2)
# Search Scope: sub
# Total entries: 2

# Entry 1: mail=100@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany...
dn: mail=100@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
mailQuotaCount: 10000
sn: 100
objectClass: top
objectClass: HyMailIspAccount
objectClass: inetOrgPerson
lastChange: 1144393936
mail: 100@myCompany.com
telephoneNumber: 100
mailMessageStore: /var/qmail/maildirs/myCompany.com/100/
givenName: 100
accountStatus: active
mailQuota: 102400000S,10000C
cn: 100
mailQuotaSize: 102400000
deliveryMode: localdelivery
delete: FALSE
homeDirectory: /var/qmail/maildirs/myCompany.com/100/
userPassword: abc123
uid: 100@myCompany.com

# Entry 2: mail=101@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany...
dn: mail=101@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
mailQuotaCount: 10000
sn: 101
objectClass: top
objectClass: HyMailIspAccount
objectClass: inetOrgPerson
lastChange: 1144393955
mail: 101@myCompany.com
telephoneNumber: 101
mailMessageStore: /var/qmail/maildirs/myCompany.com/101/
givenName: 101
accountStatus: active
mailQuota: 102400000S,10000C
cn: 101
mailQuotaSize: 102400000
deliveryMode: localdelivery
delete: FALSE
homeDirectory: /var/qmail/maildirs/myCompany.com/101/
userPassword: {MD5}oUHEeSeSm8LR+20zaiVt9A==
uid: 101@myCompany.com


  Help me modify res_ldap.conf,extconfig.conf,... to log in to SIP phones with the accounts.

Thanks ...!

By: Manuel Guesdon (mguesdon) 2006-04-14 05:19:54

corruptor,

Could you send me you config.c (to mguesdon AT oxymium.net). May be a patch has not been integrated

Manuel

By: Manuel Guesdon (mguesdon) 2006-04-14 05:22:34

supervga,

Could you provide your configuration files some logs or details ?

Manuel

By: lam (supervga) 2006-04-14 23:14:46

hi mguesdon....

****    my file ldif  **************

version: 1

# LDIF Export for: jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
# Generated by phpLDAPadmin on April 13, 2006 9:08 am
# Server: My LDAP Server (192.168.1.2)
# Search Scope: sub
# Total entries: 2

# Entry 1: mail=100@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany...
dn: mail=100@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
mailQuotaCount: 10000
sn: 100
objectClass: top
objectClass: HyMailIspAccount
objectClass: inetOrgPerson
lastChange: 1144393936
mail: 100@myCompany.com
telephoneNumber: 100
mailMessageStore: /var/qmail/maildirs/myCompany.com/100/
givenName: 100
accountStatus: active
mailQuota: 102400000S,10000C
cn: 100
mailQuotaSize: 102400000
deliveryMode: localdelivery
delete: FALSE
homeDirectory: /var/qmail/maildirs/myCompany.com/100/
userPassword: abc123
uid: 100

# Entry 2: mail=101@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany...
dn: mail=101@myCompany.com,jvd=myCompany.com,o=qmail,dc=myCompany,dc=com
mailQuotaCount: 10000
sn: 101
objectClass: top
objectClass: HyMailIspAccount
objectClass: inetOrgPerson
lastChange: 1144393955
mail: 101@myCompany.com
telephoneNumber: 101
mailMessageStore: /var/qmail/maildirs/myCompany.com/101/
givenName: 101
accountStatus: active
mailQuota: 102400000S,10000C
cn: 101
mailQuotaSize: 102400000
deliveryMode: localdelivery
delete: FALSE
homeDirectory: /var/qmail/maildirs/myCompany.com/101/
userPassword: {MD5}oUHEeSeSm8LR+20zaiVt9A==
uid: 101



********   my res_ldap.conf  ***********

[_general]
dbhost=192.168.1.2              ; LDAP host(s)
dbbasedn=jvd=myCompany.com,o=qmail,dc=myCompany,dc=com ; Base DN
dbpass=myCompany1428               ; Bind password
dbuser=o=qmail,dc=myCompany,dc=com ; Bind DN

; Configuration Table
[config]
; addtional filter
additionalFilter=(objectClass=inetOrgPerson)    ; oxyPBXConfig)

; Extensions Table
[extensions]
additionalFilter=(objectClass=inetOrgPerson)   ; oxyPBXExtension)

// Sip Users Table
[sip1]
attribute = name => uid
attribute = username => uid
attribute = md5secret => userPassword
attribute = context => default
additionalFilter=(objectClass=inetOrgPerson)

;******************************************

if i use extconfig.conf as:

sipusers => ldap,dc=myCompany,sip1
sippeers => ldap,dc=myCompany,sip1
extensions => ldap,dc=myCompany,extensions
sip.conf => ldap,dc=myCompany,config

my log file is:
.........
Apr 14 20:16:05 DEBUG[2719] res_config_ldap.c: LDAP RealTime (806): realtime_ldap: basedn: dc=myCompany table_name: sip1
Apr 14 20:16:05 DEBUG[2719] res_config_ldap.c: LDAP RealTime (581): realtime_ldap_base: basedn: dc=myCompany table_name: sip1
Apr 14 20:16:05 DEBUG[2719] res_config_ldap.c: LDAP RealTime: bind to 192.168.1.2 as o=qmail,dc=myCompany,dc=com
Apr 14 20:16:57 DEBUG[2656] manager.c: Manager received command 'Command'
Apr 14 20:16:57 DEBUG[2656] manager.c: Manager received command 'Command'
Apr 14 20:18:57 DEBUG[2656] manager.c: Manager received command 'Command'
Apr 14 20:18:57 DEBUG[2656] manager.c: Manager received command 'Command'
Apr 14 20:19:14 WARNING[2719] res_config_ldap.c: LDAP RealTime: bind failed: Can't contact LDAP server
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 20:19:14 NOTICE[2719] chan_sip.c: Registration from '101 ' failed for '192.168.0.134' - Username/auth name mismatch
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LDAP RealTime (806): realtime_ldap: basedn: dc=myCompany table_name: sip1
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LDAP RealTime (581): realtime_ldap_base: basedn: dc=myCompany table_name: sip1
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LDAP RealTime: bind to 192.168.1.2 as o=qmail,dc=myCompany,dc=com
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LDAP RealTime: Successfully connected to database.
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LDAP RealTime: substituted: string: 'dc=myCompany' => 'dc=myCompany'
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LDAP RealTime (479): basedn: 'dc=myCompany' => 'dc=myCompany'
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LDAP RealTime (643): filter: (&(objectClass=inetOrgPerson)(uid=101))
Apr 14 20:19:14 WARNING[2719] res_config_ldap.c: LDAP RealTime: Could not find any entry matching (&(objectClass=inetOrgPerson)(uid=101)) in base dn dc=myCompany.
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 20:19:14 DEBUG[2719] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 20:19:14 NOTICE[2719] chan_sip.c: Registration from '101 ' failed for '192.168.0.134' - Username/auth name mismatch
...............


if my extconfig.conf is:

sipusers => ldap,"dc=myCompany",sip1
sippeers => ldap,"dc=myCompany",sip1
extensions => ldap,"dc=myCompany",extensions
sip.conf => ldap,"dc=myCompany",config

then Asterisk crashed.

if my extconfig.conf is:

sipusers => ldap,"dc=myCompany,dc=com",sip1
sippeers => ldap,"dc=myCompany,dc=com",sip1
extensions => ldap,"dc=myCompany,dc=com",extensions
sip.conf => ldap,"dc=myCompany,dc=com",config




then log file is:

..........
Apr 14 20:56:51 VERBOSE[2260] logger.c: Asterisk Ready.
Apr 14 20:57:59 DEBUG[2713] res_config_ldap.c: LDAP RealTime (806): realtime_ldap: basedn: "dc=myCompany table_name: dc=com"
Apr 14 20:57:59 DEBUG[2713] res_config_ldap.c: LDAP RealTime (581): realtime_ldap_base: basedn: "dc=myCompany table_name: dc=com"
Apr 14 20:57:59 DEBUG[2713] res_config_ldap.c: LDAP RealTime: bind to 192.168.1.2 as o=qmail,dc=myCompany,dc=com
Apr 14 20:58:39 DEBUG[2641] manager.c: Manager received command 'Command'
Apr 14 20:58:39 DEBUG[2641] manager.c: Manager received command 'Command'
Apr 14 21:00:39 DEBUG[2641] manager.c: Manager received command 'Command'
Apr 14 21:00:39 DEBUG[2641] manager.c: Manager received command 'Command'
Apr 14 21:01:08 WARNING[2713] res_config_ldap.c: LDAP RealTime: bind failed: Can't contact LDAP server
Apr 14 21:01:08 DEBUG[2713] res_config_ldap.c: LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 21:01:08 DEBUG[2713] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 21:01:08 NOTICE[2713] chan_sip.c: Registration from '101 ' failed for '192.168.0.134' - Username/auth name mismatch
Apr 14 21:01:08 DEBUG[2713] res_config_ldap.c: LDAP RealTime (806): realtime_ldap: basedn: "dc=myCompany table_name: dc=com"
Apr 14 21:01:08 DEBUG[2713] res_config_ldap.c: LDAP RealTime (581): realtime_ldap_base: basedn: "dc=myCompany table_name: dc=com"
Apr 14 21:01:08 DEBUG[2713] res_config_ldap.c: LDAP RealTime: bind to 192.168.1.2 as o=qmail,dc=myCompany,dc=com
Apr 14 21:02:39 DEBUG[2641] manager.c: Manager received command 'Command'
Apr 14 21:02:39 DEBUG[2641] manager.c: Manager received command 'Command'
Apr 14 21:04:17 WARNING[2713] res_config_ldap.c: LDAP RealTime: bind failed: Can't contact LDAP server
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 21:04:17 NOTICE[2713] chan_sip.c: Registration from '101 ' failed for '192.168.0.134' - Username/auth name mismatch
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LDAP RealTime (806): realtime_ldap: basedn: "dc=myCompany table_name: dc=com"
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LDAP RealTime (581): realtime_ldap_base: basedn: "dc=myCompany table_name: dc=com"
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LDAP RealTime: bind to 192.168.1.2 as o=qmail,dc=myCompany,dc=com
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LDAP RealTime: Successfully connected to database.
Apr 14 21:04:17 WARNING[2713] res_config_ldap.c: LDAP RealTime: No table named 'dc=com"'.
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 21:04:17 NOTICE[2713] chan_sip.c: Registration from '101 ' failed for '192.168.0.134' - Username/auth name mismatch
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LDAP RealTime (806): realtime_ldap: basedn: "dc=myCompany table_name: dc=com"
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LDAP RealTime (581): realtime_ldap_base: basedn: "dc=myCompany table_name: dc=com"
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LDAP RealTime: Everything seems fine.
Apr 14 21:04:17 WARNING[2713] res_config_ldap.c: LDAP RealTime: No table named 'dc=com"'.
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 21:04:17 DEBUG[2713] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 14 21:04:17 NOTICE[2713] chan_sip.c: Registration from '101 ' failed for '192.168.0.134' - Username/auth name mismatch
.......

help me! (i use X-Lite Phone to connect)

Thanks!

By: Manuel Guesdon (mguesdon) 2006-04-15 06:00:53

Could you verify that your config/config.c integrate patch from the following bug report ?
http://bugs.digium.com/view.php?id=5854

By: Andrey Solovyev (corruptor) 2006-04-17 08:07:42

Mguesdon, i've updated Asterisk to ver 1.2.7.1, made some changes to Makefile, patched config.c, compiled and now Asterisk doesn't crash. Unfortunately now I can't  reproduce the crash.
My softphone (SjPhone, number 253) registers fine. But...
I've got tha same problem as supervga has:
Apr 17 16:10:03 DEBUG[8388] db.c: Unable to find key '253' in family 'SIP/Registry'
I don't see "Seeding peer/user XXX to Astdb..." as I saw when I used astirectory.
When I try to call 253 I get CHANISUAVAIL but I can call any phone from 253!
There is a big thread about this problem in asterisk-users lists (it's about ARA + MySQL) but reading it hasn't helped me to solve the problem.
How can I solve the problem? Maybe I should use version from SVN?

 
Here is the debug info:
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: LOG Variable: LDAP RealTime: ==>Found Entry
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: dtmfmode => rfc2833
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: context => from-internal
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: name => 253
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: objectClass => top
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: objectClass => oxyPBXAccount
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: objectClass => oxyPBXAccountSIP
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: callerid => FromLdap <253>
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: username => 253
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: secret => secret
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: host => dynamic
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: type => friend
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: nat => no
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: port => 5060
Apr 17 16:49:35 DEBUG[8388] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 17 16:49:35 DEBUG[8388] db.c: Unable to find key '253' in family 'SIP/Registry'

Thank you.



By: lam (supervga) 2006-04-19 05:30:18

hi mguesdon.

I have patched file config.c but when log in to X-Lite then:

log file has
.................
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: mailQuotaSize => 102400000
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: deliveryMode => localdelivery
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: delete => FALSE
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: homeDirectory => /var/qmail/maildirs/myCompany.com/100/
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: username => 100
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: host => dynamic
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 15 06:56:42 DEBUG[2295] db.c: Unable to find key '100' in family 'SIP/Registry'
Apr 15 06:56:42 DEBUG[2295] db.c: Unable to find key '100' in family 'SIP/Registry'


my res_ldap.conf is:

[_general]
dbhost=192.168.1.2 ; LDAP host(s)
dbbasedn=jvd=myCompany.com,o=qmail,dc=myCompany,dc=com ; Base DN
dbpass=myCompany1428 ; Bind password
dbuser=o=qmail,dc=myCompany,dc=com ; Bind DN

; Configuration Table
[config]
; addtional filter
additionalFilter=(objectClass=inetOrgPerson)    ; oxyPBXConfig)

; Extensions Table
[extensions]
attribute = exten  => telephoneNumber  
additionalFilter=(objectClass=inetOrgPerson)   ; oxyPBXExtension)

// Sip Users Table
[sip1]
attribute = name => uid
attribute = username => uid
attribute = md5secret => userPassword
attribute = context => default
attribute = host => mailHost    ; =dynamic
attribute = regexten => telephoneNumber
additionalFilter=(objectClass=inetOrgPerson)




help me!

Thanks!

By: Andrey Solovyev (corruptor) 2006-04-21 06:32:50

This should be added to documentation.
supervga, just add:
rtcachefriends=yes to sip.conf in [general] section.

Now it works. Of course more deep testing is needed but at least I can call the registered sip device.



By: Andrey Solovyev (corruptor) 2006-04-21 10:06:37

After adding rtcachefriends=yes I have to do "sip reload" in order to any configuration change in directory take effect.
So it's not realtime. Is it the way it should be?

By: lam (supervga) 2006-04-21 21:47:50

hi..
i have added rtcachefriends=yes to sip.conf in [general] section and have done "sip reload".
it don't work.

.....

Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: mailQuotaSize => 102400000
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: deliveryMode => localdelivery
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: delete => FALSE
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: homeDirectory => /var/qmail/maildirs/myCompany.com/100/
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: username => 100
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: host => dynamic
Apr 15 06:56:42 DEBUG[2295] res_config_ldap.c: END LOG Variable: LDAP RealTime: ==> Found Entry
Apr 15 06:56:42 DEBUG[2295] db.c: Unable to find key '100' in family 'SIP/Registry'
Apr 15 06:56:42 DEBUG[2295] db.c: Unable to find key '100' in family 'SIP/Registry'




help me!

Thanks!



By: Daniel Swarbrick (pressureman) 2006-04-21 22:04:48

@corruptor and supervga:

Please stop using this bug tracker like a help forum. Take your discussion offline to email, or discuss in asterisk-users list where others (who aren't monitoring this bug) might also benefit.

People who are monitoring this bug for changes in mod_res_ldap will get annoyed at having to read through your (very basic) troubleshooting discussion.

@corruptor:

Go and read up on Asterisk RealTime. What you are encountering with rtcachefriends is normal.

By: Serge Vecher (serge-v) 2006-05-04 10:58:42

Changing status to new since we only seem to be waiting for positive (or otherwise) test reports ...

By: Olle Johansson (oej) 2006-05-17 02:42:57

Made some formatting changes to confirm with the coding gudielines. Please check that I did not accidentally change functionality.

Any testing feedback? Anyone that got this driver to work?

By: phsultan (phsultan) 2006-06-06 16:31:49

The following patch (res_config_ldap-formatting.1.patch) addresses code formatting and debug messages issues, as well as a driver loading issue.

Summary :
- uses ast_copy_string instead of strncpy (cf CODING GUIDELINES)
- adds return statements to shorten indentation in the following
 functions (cf CODING GUIDELINES) :
 + parse_config
 + ldap_reconnect
- removes the "LDAP RealTime :" prefix in log messages (already prefixed by the filename)
- prevents from loading and registering if the configuration file is missing

By: Serge Vecher (serge-v) 2006-06-16 15:39:58

nobody tested this :( ??

By: Russell Bryant (russell) 2006-06-16 19:29:20

merged the coding guidelines updates to the branch in rev 34549

By: Russell Bryant (russell) 2006-06-16 19:29:50

Out of all of the people monitoring this bug, nobody has a positive test report?

By: Gavin Henry (suretec) 2006-08-07 16:24:35

Is this still the place to come with testing results and the latest code? Or is there a branch for it now?

By: Russell Bryant (russell) 2006-08-07 16:51:39

Test reports should be provided here.

The code is in a branch:

svn co http://svn.digium.com/svn/asterisk/team/oej/res_config_ldap

By: Gavin Henry (suretec) 2006-08-08 02:41:45

Quick one. I take it we'll need svn zaptel to test this yeah?

Thanks.

By: Gavin Henry (suretec) 2006-08-08 02:42:20

And libpri. make is complaining.

By: Gavin Henry (suretec) 2006-08-08 04:35:57

I can't seem to find the example OpenLDAP schema in svn either?

By: Russell Bryant (russell) 2006-08-08 15:02:01

The old res_config_ldap branch is extremely out of date.  I have created a new branch for it that is up to date and should have all of the appropriate files:

svn co http://svn.digium.com/svn/asterisk/team/group/res_config_ldap

the ldap schema example is in doc/ldap.txt

By: Russell Bryant (russell) 2006-08-08 15:05:13

And yes, if you need zaptel and libpri, you will need the trunk versions.

By: Russell Bryant (russell) 2006-08-08 15:07:01

And just so everyone monitoring this knows, this feature is still up for consideration to be merged into Asterisk 1.4.  The biggest thing holding it back right now is the complete lack of test reports.

By: Serge Vecher (serge-v) 2006-08-08 15:16:05

should all configuration options be prefixed with 'oxyPBX'. I think it would make more sense to either pref with something associated with Asterisk proper, like 'ast_', or none at all. And of course, oxymium/mguedson would receive a proper credit in the CREDITS file. Just my 2c.

By: Gavin Henry (suretec) 2006-08-08 16:32:38

I agree. Make the config more LDAP like, i.e. remove the oxy, but keep credits clearly shown.

Do we have any idea what OpenLDAP server version this has been tested with, what version of OL, ldap.h has been used from?

I hope to test and try and get more things added to the connection, at least Start_TLS etc. The lack of this is a concern of mine, but it's early days.

Also, I really dislike dbhost, dbbasedn etc. That's not normal LDAP terminology (normal is just host, basedn), but doesn't warrant a patch ;-)

What would your thoughts be on trying to source settings from the system wide /etc/ldap.conf ?

Then again, Asterisk will usually be on a dedicated server, so ldapsearch/clients won't be configured anyway.

Lastly, the doc/ldap.txt holds example ldap entries (Attribute Types), not the schema definition that holds all the object classes. That's still in the first upload of res_config_ldap.tgz

But it's an example only, and can be re-written by your ldap admins/gurus (more at http://www.openldap.org/doc/admin23/schema.html).

Maybe even better with OID Macros (http://www.openldap.org/doc/admin23/schema.html), as the schema is quite big already. But hey, lets get it tested more first! ;-)

Maybe it should be re-written with the Digium Private Enterprise OID (22736 at http://www.iana.org/assignments/enterprise-numbers) to keep it consistent with the SNMP Res?

Anyway, hope to get some more time and a spare machine this week.

Do we have a 1.4 deadline for inclusion?

Thanks.

By: Russell Bryant (russell) 2006-08-08 17:19:53

I'll go back and find the example schema and put it in the branch.

As for the prefixing with "oxyPBX", I agree.  I'll make sure that is changed before anything makes it to the trunk.

As for the deadline for 1.4, we are already behind schedule so I can't give you any kind of date.  We may release a beta next week, or maybe in a month.  The best I can say is that if it's ready before the first beta, it can go in ...

By: Gavin Henry (suretec) 2006-08-09 05:15:24

Understood, thanks.

By: Gavin Henry (suretec) 2006-08-09 15:20:50

Just got this, as this code was written for an old ldap.h:

res_config_ldap.c: In function ?realtime_ldap_entry_to_var?:
res_config_ldap.c:279: warning: implicit declaration of function ?ldap_get_values?
res_config_ldap.c:279: warning: assignment makes pointer from integer without a cast
res_config_ldap.c:306: warning: implicit declaration of function ?ldap_value_free?
res_config_ldap.c: In function ?ldap_loadentry?:
res_config_ldap.c:338: warning: implicit declaration of function ?ldap_search_s?
res_config_ldap.c:348: warning: implicit declaration of function ?ldap_unbind_s?
res_config_ldap.c: In function ?ldap_reconnect?:
res_config_ldap.c:1098: warning: implicit declaration of function ?ldap_init?
res_config_ldap.c:1098: warning: assignment makes pointer from integer without a cast
res_config_ldap.c:1106: warning: implicit declaration of function ?ldap_simple_bind_s?
res_config_ldap.c:1119: warning: implicit declaration of function ?ldap_unbind?

If I define LDAP_DEPRECATED=1 through
the build environment, it's fine. But I want to update it.

We can add some errors about what version of ldap.h the builder has.

Just getting info on what replaces these in the new OL 2.3 (which everyone should be using, as we're almost at 2.4 now) from our mates in the OL devel team ;-)

Gavin.



By: Gavin Henry (suretec) 2006-08-10 10:06:58

Still got a few silly things to fix ;-) , as I'm getting:

  [CC] res_config_ldap.c -> res_config_ldap.o
res_config_ldap.c: In function ?realtime_ldap_entry_to_var?:
res_config_ldap.c:280: warning: assignment from incompatible pointer type
res_config_ldap.c:307: warning: passing argument 1 of ?ldap_value_free_len? from incompatible pointer type
res_config_ldap.c: In function ?ldap_reconnect?:
res_config_ldap.c:1100: warning: passing argument 1 of ?ldap_initialize? from incompatible pointer type
res_config_ldap.c:1100: warning: passing argument 2 of ?ldap_initialize? makes pointer from integer without a cast
res_config_ldap.c:1100: warning: assignment makes pointer from integer without a cast
res_config_ldap.c:1109: warning: passing argument 4 of ?ldap_sasl_bind_s? from incompatible pointer type

I changed some of the wording to remove the word database etc.

A long way to go, but submitting a patch in case I lose this.

Gavin

By: Serge Vecher (serge-v) 2006-08-10 10:16:14

suretec: please confirm your disclaimer status with a note (if you haven't faxed a disclaimer to Digium yet, please do so). Thanks.

By: Gavin Henry (suretec) 2006-08-10 10:20:10

How do you mean? GPLv2?

Example?

By: Gavin Henry (suretec) 2006-08-14 15:38:40

Hi again,

What kind of testing framework does stock Asterisk use? Can I plug any LDAP tests into it if there is one?

How can you simulate calls etc.?

I never noticed a "make test" ;-)

Thanks.

By: Serge Vecher (serge-v) 2006-08-14 15:50:43

suretec: regarding disclaimer, please take a look at the bottom of the following page: http://bugs.digium.com/main_page.php . You will need one of the disclaimer forms signed and sent to Digium before your code contribution could be considered for inclusion.

Thanks!

By: Gavin Henry (suretec) 2006-08-16 11:30:29

Disclaimer Faxed!

Thanks,

Gavin.

By: Gavin Henry (suretec) 2006-08-18 07:38:26

Digium have confirmed receipt of our Disclaimer fax.

Gavin.

By: Gavin Henry (suretec) 2006-08-18 08:21:06

What do you guys do to check for certain versions of header files?

I noticed checks for the presence of headers in configure.ac, but not for versions.

Is this some we do?

Gavin.

By: Serge Vecher (serge-v) 2006-08-18 08:28:03

maybe this will point you in the right direction http://lists.digium.com/pipermail/svn-commits/2006-August/015945.html

By: Russell Bryant (russell) 2006-08-18 18:37:18

Well, the part that you need to look at in configure.ac is the following line:

AST_EXT_LIB_CHECK([LDAP], [ldap], [ldap_first_attribute], [ldap.h])

The easiest thing to do is to change the function we look for which is currently ldap_first_attribute(), to a function that only exists in versions that are supported.

To test changes to the configure script, it will need to be re-generated with the ./bootstrap.sh script.

By: Gavin Henry (suretec) 2006-08-20 02:52:43

Understood. I really don't know how I missed that in configure.ac

Thanks.

By: Gavin Henry (suretec) 2006-09-04 08:01:35

Sorry, my workload has increased again.

Hope to get back on this in the next week,

Thanks,

Gavin.

By: rocky tseng (rocky) 2006-09-08 23:53:35

Can anybody tell me how to install the res_config_ldap?because i take many effort,but can't compile success.Please tell me that your install method,thank's!
rocky

By: Gavin Henry (suretec) 2006-09-10 09:27:26

Rocky, what have you tried (versions of asterisk/zaptel/libpri etc.)?

Thanks,

Gavin.

By: Denis Smirnov (mithraen) 2006-09-11 22:16:42

Can anyone update it to last trunk (with new module loader)?

By: Fernando Ribeiro (fernando) 2006-10-11 10:10:05

I don't know why the resource need new schema. It can't to take only username (uid) and password (userPassword) from ldap without schema extend?


Best Regards,
Fernando Ribeiro

By: Gavin Henry (suretec) 2006-10-11 10:28:34

Well, it needs it's own schema for the custom Asterisk Attirbutes for all config settings. This is *not* and Authentication module remember.

We might be hiring/dedicating a resource soon to finish this and get it working with the new LDAP functions and 1.4 realtime infrastructure.

Gavin.

By: jmls (jmls) 2006-11-08 05:37:47.000-0600

were you able to get that resource ?

By: Gavin Henry (suretec) 2006-11-08 05:51:02.000-0600

No, not yet. Another project has come up. I'll be getting back on to it soon hopefully.

Does anyone know if the current realtime config on this will work with 1.4?

Gavin.

By: Carl Thorner (cthorner) 2006-11-10 21:09:38.000-0600

Hi,

I proably should have posted something on this forum earlier. I am a developer for VoiceRD and have been running res_ldap since March. Currently running on version 0.7 with a lot of modifications to make it work the way I need it to. There are several issues that need to be resolved before it can be considered stable, though. I added support for multiple variables with the same name(like the allow and disallow variables in sip.conf) most recently but it is still not working perfectly for the static realtime. Another issue is the update function. At the moment it is set to NULL. This is a problem for applications like Voicemail which tries to change the password. Obviously there are work arounds for this, but it would be nice to get it working as it should in asterisk.

Anyway, I would be happy to contribute whatever I can to this project. Using LDAP for the realtime stuff is making a lot of things, like clustering and configuration, managable on an enterprise level.

Now for the question:
How do I start contributing?

-Carl

By: Gavin Henry (suretec) 2006-11-11 04:26:54.000-0600

Great. Thanks for that. I'm not feeling so guilty now about being slow! ;-)

See http://bugs.digium.com/main_page.php

Cheers,

Gavin.

By: Serge Vecher (serge-v) 2006-11-15 12:03:00.000-0600

russell: I know you are busy with school, but I was wandering if you could update http://svn.digium.com/view/asterisk/team/group/res_config_ldap or perhaps hand this off to another developer so work could be continued...

By: Serge Vecher (serge-v) 2006-11-15 16:32:32.000-0600

cthorner: I will expand a bit on suretec's suggestion:

1. Please get a disclaimer on file, see the bottom of the link suretec provided.
2. Review the patch how-to at http://www.asterisk.org/developers/Patch_Howto as well as sections of http://www.asterisk.org/developers/svn-branching-merging that have to do with making patches against developer branches.
3. Post your patch against the latest trunk.

By: Carl Thorner (cthorner) 2006-11-15 18:39:19.000-0600

Thanks serge-v,

Waiting to get the go ahead to send in the disclaimer from my superiors. Shouldn't be a problem, just takes a little while.

-Carl

By: Russell Bryant (russell) 2006-11-15 19:46:51.000-0600

I do not have time to do anything with this branch right now.  However, the branch is in the "group" area, so every developer with commit access has the ability to commit to it.  For any developers seeing this, feel free to take over maintaining this branch ...

By: Olle Johansson (oej) 2006-11-16 09:29:05.000-0600

I've updated the branch to svn trunk. Please test!

There was some issues with configure and autoconfig - please check those files.

By: Gavin Henry (suretec) 2006-11-29 10:43:28.000-0600

Any news on the disclaimer or new code cthorner?

Does your code use the new OpenLDAP libs?

Thanks.

By: Carl Thorner (cthorner) 2006-12-02 00:30:57.000-0600

Hi,

So Digium has my disclaimer on file now. I have to merge my changes to the svn and make sure we are using the new libraries. It is a work in progress. I have next week dedicated to working on this and hopefully completing some of the features that need more work. As far as the new OpenLDAP libraries goes I am using whatever the first code was submitted with. I will check to make sure that we are using the latest and greatest libraries before I submit.

-Carl



By: Gavin Henry (suretec) 2006-12-02 02:54:17.000-0600

Ah, great!

The new libs use different functions, but still support older code, if you specify LDAP_DEPRECATED=1

If you see the 2 patches I half finished, I've updated the function calls there:

http://bugs.digium.com/file_download.php?file_id=11174&type=bug
http://bugs.digium.com/file_download.php?file_id=11175&type=bug

I never got time to get them finished. If you could start there, that would be great.

Also we/I need to finish the configure autodetect of the current installed libs, and maybe set LDAP_DEPRECATED=1 if using old libs, or bite the bullet and say we only support OpenLDAP 2.3.x, as most distros now come with this. I would prefer the later.

Thanks,

Gavin.

By: Anthony LaMantia (alamantia) 2006-12-04 14:47:03.000-0600

has anyone been able to run configure properly with after the latest update of the group branch against trunk?



By: Anthony LaMantia (alamantia) 2006-12-06 12:29:13.000-0600

ah, it seems after running ./bootstrap.sh to generate a new configure file via autoconf the errors i as experiencing were resolved via upgrading my copy of automake ( one that supports _AC_PATH_PROG_FEATURE_CHECK ).

By: Carl Thorner (cthorner) 2006-12-06 12:31:30.000-0600

Having problems getting the configure script to work so I tried autoconf and the bootstrap.sh script. No luck:

With autoconf and the bootstrap.sh script:

configure:3793: error: possibly undefined macro: _AC_PATH_PROG_FEATURE_CHECK
     If this token and others are legitimate, please use m4_pattern_allow.
     See the Autoconf documentation.
configure:3794: error: possibly undefined macro: _AC_FEATURE_CHECK_LENGTH

When I run configure:

checking for a sed that does not truncate output... ./configure: line 3793: syntax error near unexpected token `SED,'
./configure: line 3793: `     _AC_PATH_PROG_FEATURE_CHECK(SED, sed gsed,'

Any suggestions?

-Carl

By: Anthony LaMantia (alamantia) 2006-12-06 15:38:36.000-0600

the best thing to do is update your copies on automake and autoconf to the latest version. other then that. you can do the "hackish" thing and open acinclude.m4 and aclocal.m4 (if it exists on your system) in the directory where you extracted the asterisk source.

and comment out 3 lines at the end of the script

as it is below.

    $as_unset ac_script || ac_script=
#     _AC_PATH_PROG_FEATURE_CHECK(SED, [sed gsed],
#       [_AC_FEATURE_CHECK_LENGTH([ac_path_SED], [ac_cv_path_SED],
#               ["$ac_path_SED" -f conftest.sed])])])
SED="$ac_cv_path_SED"


then you should be able to run bootstrap without an error maybe a few warnings, then configure should work fine.

By: Carl Thorner (cthorner) 2006-12-07 18:04:15.000-0600

Updating autoconf worked nicely. Thanks. The bootstrap.sh, configure, make, make install worked without a hitch, except for the bugs in res_config_ldap.c ;)

-Carl

By: Serge Vecher (serge-v) 2006-12-08 08:35:23.000-0600

let's get 'em fixed!

By: Anthony LaMantia (alamantia) 2006-12-12 16:09:53.000-0600

suretec, others,

i am taking a stab at removing the deprecated api calls, as well as cleaning up alot of the code inside of realtime_ldap_base(), which will make fixing some of the existing bugs and extending the code a lot simpler.

as far as bugs in this module go, if you have experianced any can you update this issue with them so we can work on fixing them up?

By: Gavin Henry (suretec) 2006-12-13 04:06:37.000-0600

Cool. Great work! In my patch all the outdated functions have been updated, so that should be a good starting place.

Let me know if you need any other help.

Thanks,

Gavin.

By: Carl Thorner (cthorner) 2006-12-13 12:35:51.000-0600

Hi,

I fixed the code so it compiles, there are still some bugs. I have been developing for 1.2 and there seem to be a lot of changes for 1.4 that I am trying to wrap my head around.

How do I commit my changes to the svn branch? Do I just uploaded it to this bug?

-Carl

By: Anthony LaMantia (alamantia) 2006-12-13 13:20:56.000-0600

cthorner,

sure just upload them to this issue, and i can commit them to the group branch for you. the code in the svn branch dose compile. or do you mean you are you backporting the code in the branch to 1.2?

By: Scott Williamson (swilliamson) 2006-12-15 13:24:05.000-0600

Cool, I got the code from SVN (noted below) to run searches against our Novell eDirectory server here. This is part of a project to hook voicemail (and the email to voicemail functionality) to the enterprise directory.

Here is the config I used.

extconfig.conf:

voicemail => ldap,"ou=people,o=trentu",voicemail

res_ldap.conf:

[voicemail]
;attribute = uniqueid => UID
attribute = mailbox => telephoneNumber
;attribute = context =>
attribute = password => telephoneNumber ; kludge due to missing addtib in our dir
attribute = email => mail
attribute = fullname => fullName
additionalFilter=(objectClass=inetOrgPerson)

voicemail.conf:

searchcontexts=yes

ver: Asterisk SVN-group-res_config_ldap-r48334M built by root @ server1 on a i686 running Linux on 2006-12-13 19:12:18 UTC



By: Carl Thorner (cthorner) 2006-12-15 13:31:57.000-0600

We have been running the voicemail functionality with Novell eDirectory for a while. It works well except for updating your voicemail password. I am almost done writing in that right now and will submit something today after I have cleaned up the code a little.

-Carl

By: Anthony LaMantia (alamantia) 2006-12-15 13:46:47.000-0600

cthorner, are you on our freenode irc channel at all?, i think we are working on the same issues a bit, it would be usefull to talk :)

By: Carl Thorner (cthorner) 2006-12-15 15:19:35.000-0600

I am now. nick: cthorner

By: Scott Williamson (swilliamson) 2006-12-15 15:32:22.000-0600

I wanted to join in the channel, but firewall is blocking. If you guys want help testing, I am in.

By: Gavin Henry (suretec) 2006-12-15 15:55:41.000-0600

Has the schema been changed/worked on at all yet?

Gavin.

By: Carl Thorner (cthorner) 2006-12-15 17:38:38.000-0600

The schema is not dependent on ldap realtime. Do we want to include an example ldif with neutral attribute names?

I have a bunch created for VoiceRD which are waiting to get their ASN numbers assinged, but we probably wouldn't want to use those because of the naming(prefixed with VoiceRD).

-Carl

By: Anthony LaMantia (alamantia) 2006-12-15 17:51:13.000-0600

right now there is an example ldif inside of doc/ldap.txt

By: Anthony LaMantia (alamantia) 2006-12-18 12:26:39.000-0600

cthorner, did you get anywhere with the realtime_update() support that we talked about on irc on friday?

By: Carl Thorner (cthorner) 2006-12-18 14:45:04.000-0600

Hi,

Everything always takes a little longer than one would hope and expect with these sort of things, but I finally managed to finish the code and do some QA on it. It includes the update function and has a lot of other modifications. I am sure there are things we will want to change to make it either more or less flexible as we go along.
Please test and let me know how it goes.

-Carl

By: Gavin Henry (suretec) 2006-12-18 15:09:49.000-0600

If anyone has worked on this, coding wise, can we make sure everyone is acknowledged in the Credits/Authors at the top

Will test soon.

Many thanks,

Gavin.

By: Anthony LaMantia (alamantia) 2006-12-18 16:44:55.000-0600

cthorner,
i've commited your patch to subversion for testing and debugging.

By: Carl Thorner (cthorner) 2006-12-18 17:13:30.000-0600

Hi all,

As far as testing goes, I am running a 1.2 compiled version of this code on about 20+ servers with average load of somwhere in the range 40-100 users each and some with 200-1000 users; however, they are all running in the same environment, on a SuSE Linux Enterprise Server and with eDirectory. If anyone could do some testing on some different systems and other LDAP platforms that would be helpful.

Another matter is getting some ASN numbers registered. Does anyone have any input on how the attributes for LDAP in the sample configuration file should look? There was talk about prefixing them with "ast". For VoiceRD, which is the open source project that has been running on the realtime ldap since its first release half a year ago, all the attributes are prefixed with either oxyPBX or VoiceRD. We have a block of IANA ASN numbers allocated for this project and we were just about to assign them. If the sample attributes are prefixed with "oxyPBX, "VoiceRD", "Asterisk", or "ast" doesn't really matter to me, as long as they have a prefix. Getting some ASN numbers assinged is important to make this a usable solution across all platforms.

Also, it would be nice if VoiceRD was mentionend in the credits somewhere, since they sponsered all my work.

-Carl

By: Carl Thorner (cthorner) 2006-12-18 17:28:50.000-0600

Thanks alamantia.

I checked out a fresh copy and it runs fine. Managed to change my password in Voicemail with the new update function.



By: Gavin Henry (suretec) 2006-12-19 03:00:58.000-0600

According to http://www.iana.org/assignments/enterprise-numbers, Digium already have one. So just switch the current number in the schema for this one:

22736

Also, the schema would look better with "OID Macros", see:

http://www.openldap.org/doc/admin23/schema.html#Extending%20Schema

Gavin.

By: Anthony LaMantia (alamantia) 2006-12-20 12:05:07.000-0600

I have been re-working the schema that i have been using the past week or so for testing (asterisk.schema) to something that is more presentable that i can upload to this issue, ATM i am just using contrived OID's( a bad practice ) for most of my testing. which is one thing that has prevented me from uploading them.

it would be nice to have something we can have alloted as an asterisk "standard" schema but i'm not sure on the process..etc  and will have to talk to a few people about that..

By: Gavin Henry (suretec) 2006-12-20 13:19:24.000-0600

Can you upload what you've got? Digium has an OID, so we just use that.

Thanks.

By: Carl Thorner (cthorner) 2006-12-20 13:22:45.000-0600

Great. Looks like Digium just got their IANA numbers a couple of months ago, they didn't have any last time I checked. Let me know if you want any help with putting together the res_ldap.conf file or the LDIF file.

-Carl

By: Gavin Henry (suretec) 2006-12-20 13:27:41.000-0600

Well, it's way before ours, and we got ours in Feb this year. So it's been there a while ;-)

I vote that we rel_config_ldap.schema, instead of asterisk.schema to keep it clear what it's for.

By: Scott Williamson (swilliamson) 2007-01-04 11:31:29.000-0600

Hi,

Digium has offered to fast track this code into 1.4 trunk and Business Edition for 6250 USD. I work for a university in Ontario, Canada and we are looking at doing this. It would take abuot 3-4 weeks according to my sources.

If anyone would like to contribute $$ to this effort email me at scottwilliamson2 at trentu dot ca and I will coordinate the collection.

Scott

By: Gavin Henry (suretec) 2007-01-04 12:46:32.000-0600

Any official statement?

Thanks.

By: Kevin P. Fleming (kpfleming) 2007-01-05 11:42:47.000-0600

This statement in incorrect. There is no such thing as '1.4 trunk', there is the 1.4 release branch and there is the trunk development branch.

Even if the paid development group at Digium works on improving this code and integrating it, it will not be merged into the 1.4 release branch, as that branch is feature frozen. The most you can hope for is that it will be merged into the trunk (development branch), and backported to the next version of Business Edition (based on 1.4) if the Business Edition product manager deems that to be worth doing (or if a Business Edition customer makes arrangements for that to happen). The proposal Digium has made to you is for those two things to happen.

In addition, the bug tracker is not the place to post bounties. If you wish to post a bounty, use the voip-info wiki and/or the asterisk-biz mailing list.

By: Anthony LaMantia (alamantia) 2007-01-05 11:49:48.000-0600

I have uploaded my work in progress schema (named asterisk.schema for the moment). this is the one that i have been using on my testing/development setup while working on the res_config_ldap code.

By: Carl Thorner (cthorner) 2007-01-05 14:47:39.000-0600

Hey alamantia,

nice work on the schema. However, you will run into a couple of issues that need to be changed before the schema is frozen. The attribute type is case-ignore-string;that is no good because some things in the dialplan are case sensitive(like the context). If the type is case-ignore-string it, by the LDAP standard, does not matter how it is stored in LDAP and something that started out with [MyContext] could end up being [mycontext] or [MYCONTEXT] depending on the implementation. Have a look at http://forge.voicerd.org/frs/download.php/89/VoiceRD-0.8-schema.ldif for a well tested schema. Change the names to Ast... and we're done. Alternatively, if you want to start from scratch, just copy the "syntax" number from the above link.

-Carl

By: Anthony LaMantia (alamantia) 2007-01-05 15:54:51.000-0600

Ah,
thanks, for the tip, i will try to resolve this right now.

By: Gavin Henry (suretec) 2007-01-05 15:58:04.000-0600

IMHO, the schema should be a static file and not added to cn=schema, as we have no way of making sure users are using the dynamic configuration backend in OpenLDAP.

So when they restart, it won't in in cn=schema.

This will work on eDirectory etc. as it the same setup.

OpenLDAP is more powerful, so we should supply the static file and let others do the adding to cn=schema if needed.

Also, you've missed the recommended prefix of:

1.3.6.1.4.1. from the AttributeType.

I'm attaching a better layed out one in a minute ;-)

Gavin.

By: Anthony LaMantia (alamantia) 2007-01-05 16:33:32.000-0600

suretec  ok cool :) do you have dislcaimer on file btw?

By: Gavin Henry (suretec) 2007-01-05 16:50:58.000-0600

Yeah.

It's almost done now. Upload in 15.

By: Gavin Henry (suretec) 2007-01-05 16:51:52.000-0600

Yeah.

It's almost done now. Upload in 15.

btw, we should be using integers for port values etc. and whether or not an entry to to be single valued etc.

See the example in a sec.

By: Gavin Henry (suretec) 2007-01-05 16:53:50.000-0600

Any reason you skipped attribute number sequence?

By: Gavin Henry (suretec) 2007-01-05 16:55:20.000-0600

Also, from the coding side, do we have limits on string lengths etc.

Like Caller ID, so we can match up in the schema etc.

Thanks.

By: Gavin Henry (suretec) 2007-01-05 17:31:30.000-0600

Right all done.

Not changed any syntax or syntax lengths to specific types, integer etc. yet, waiting for more info from coding end.

But have defined IAX/SIP object classes as AUXILIARY in case they need to be mixed with an existing directory deployment, e.g. all SIP users entries under your uid etc.

Please read the uploaded asterisk-v2.schema.

It is very well commented and uses OID Macros for ease of reading/amending.

Gavin.

By: Anthony LaMantia (alamantia) 2007-01-05 17:56:53.000-0600

suretec  do you have disclaimer on file?

By: Gavin Henry (suretec) 2007-01-06 02:44:06.000-0600

Yes, I do. I alread said so! ;-)

Looks amoungst these threads for Proof.

It will be filed with Digium under "Suretec Systems Ltd."

Thanks,

Gavin.

By: Anthony LaMantia (alamantia) 2007-01-06 14:40:30.000-0600

oh, cool.. sorry i missed it this ticket is sort of getting rather large and i must have skimmed over it ;), either way nice job on the schema i really like the way that it is formated.

By: Gavin Henry (suretec) 2007-01-06 14:51:48.000-0600

No probs. We're professionals when it comes to OpenLDAP/LDAP ;-)

Had any thoughts on the types lengths etc. as per my last few comments?

By: Carl Thorner (cthorner) 2007-01-10 18:40:23.000-0600

Hey all,

This version is even more LDAP v3 compliant. ;) Please commit to svn...

To get it to compile with 1.4.0, just rename it like so:
mv res_config_ldap.c.0.9 res_config_ldap.c

then copy it into the res/ directory and do:

LIBS=-lldap
export LIBS

before you start ./configure; make; make install

-Carl

By: Anthony LaMantia (alamantia) 2007-01-10 18:44:08.000-0600

can you upload a svn diff?

By: Carl Thorner (cthorner) 2007-01-10 20:42:16.000-0600

I uploaded the svn diff.

Btw, I feel like a disclaimer is in order: The latest code has not been thoroughly tested. Consider this a beta, I already found a bug from my previous post earlier today.

By: Carl Thorner (cthorner) 2007-01-18 14:39:00.000-0600

The new code has now been tested more extensively, and is running in several production environments in asterisk v1.4.0. Any news on getting it into trunk?

By: Anthony LaMantia (alamantia) 2007-01-18 15:17:47.000-0600

cthorner, i have committed your latest patch to the group branch.

By: pocari (pocari) 2007-01-19 03:17:25.000-0600

hi,
 I have a question for res_config_ldap.c.0.9 . I try it , that can connection to LDAP but doesn`t get any information .
 Maybe my config , there was error . Please give me the config form , thanks .

By: Anthony LaMantia (alamantia) 2007-01-19 10:17:55.000-0600

please use the group branch
to check out the code in the branch:
svn co http://svn.digium.com/svn/asterisk/team/group/res_config_ldap

from there you can read the configuration information in the docs/ldap.txt.



By: Anthony LaMantia-2 (anthonyl) 2007-01-21 14:59:50.000-0600

i've been thinking a bit about how we can restructure the configuration file to allow multiple ldap sources and then how to store it in a linked list within res_config_ldap itself. and maybe just locate it in durring cleaned_basedn() when called from realtime_ldap_base().. cthorner do you have thoughts on that?

i wrote some base code do this and will upload a diff in the near future. the only real problem is having to prefix contexts in the config file with [server_someuniqueid]  at least thats the only way i can think of..
maybe having a entry in [general] like
sources = server1,server2,server3      and the entries server1 server2 server3 existing as context we grab from the config file later on durring the process.

By: benoit plessis (benoit plessis) 2007-02-02 03:14:24.000-0600

Hi,

I'm using asterisk on an amd64 system and i encountered seg fault due to invalid free() pointer with res_config_ldap.

I attached a patch (patch_res_config_ldap.diff) which fix the erroneous (well at least for the ldap_get_values manual page) call to ber_bvecfree().

I fixed the prototypes of the load_module/unload_module/reload functions too to avoid warning, and the AST_MODULE_INFO call at the end (removed the .description part which didn't work (at least with asterisk 1.4 it doesn't)).

PS: There is an error in the doc/ldap.txt file too, the explanation of
md5secret is wrong:
#  echo -n "UID:SIPRealm:Password" | md5sum
should be:
#  echo -n "UID:Password:SIPRealm" | md5sum



By: Carl Thorner (cthorner) 2007-02-03 18:26:45.000-0600

Hey benoit plessis,

The problem is not the code but rather that you are trying to compile and run it with a ldap v2 instead of v3 library. ldap_get_values is deprecated and replaced with ldap_get_values_len.

As for the other issues, the description and prototypes, we would need a new patch that just includes those(as an svn diff).

By: Bart De Deckere (the sheriff) 2007-03-02 17:22:31.000-0600

When i try to start Asterisk i get the following error:
asterisk: relocation error: /usr/lib/asterisk/modules/res_config_ldap.so: undefined symbol: ldap_initialize
Any suggestions?

By: Carl Thorner (cthorner) 2007-03-05 17:44:14.000-0600

did you do this before you ran ./configure :

LIBS=-lldap
export LIBS

Also, you need a version of ldap that supports LDAP v3

By: Gavin Henry (suretec) 2007-03-05 17:50:28.000-0600

What's left to do to get this into core?

By: Serge Vecher (serge-v) 2007-03-06 08:24:42.000-0600

gavin, this bug is still waiting for positive test results; not sure how dated is the branch, if it is too out of date, probably a new clean patch against trunk will be useful.

By: Gavin Henry (suretec) 2007-03-06 08:36:49.000-0600

Ok, maybe a repatch against current/stable and a mini test suite/script.

Does * have a "make test" yet? ;-)

What schema are/have we adopted?

Gavin.

By: Patrick Cole (ltd) 2007-03-07 23:55:07.000-0600

I'm running this in production for voicemail, so you can tack that up to one testing success.  No crashes thus far related to it.

By: Gavin Henry (suretec) 2007-03-08 01:42:35.000-0600

Schema?

I want to try and get the test variations right ;-)

Gavin.

By: Josemar Lohn (josemarlohn) 2007-03-08 14:34:52.000-0600

Hi All:

I tried to get the version in SVN using the command "svn co http://svn.digium.com/svn/asterisk/team/group/res_config_ldap" but the version I got no even run ./configure.
Is this right? Or there is another place to get the sources? Can I use the source of the 1.4.0 or 1.4.1?
I would like to test it and I can use it in a production envirenment.

Thanks.

By: Anthony LaMantia-2 (anthonyl) 2007-03-09 14:00:25.000-0600

I really think we need to remove the call to ldap_initialize in ldap_reconnect and replace it with ldap_open() or ldap_init() both of which are defined in the ietf standard, ldap_initialize() seems to have been dropped is more recent version of openldap

By: Gavin Henry (suretec) 2007-03-09 14:13:20.000-0600

So you want to use an old version of OpenLDAP? I don't think that's a good idea.

By: Carl Thorner (cthorner) 2007-03-09 16:21:42.000-0600

Hi guys,

So, the documentation on this is not always consistent and up to date, but according to this page:

http://xgen.iit.edu/cgi-bin/man/man2html?3+ldap

Using either "init" or "initialize" should be ok. "Initialize" is preffered though: "The basic interaction is as follows. A session handle is created using ldap_init(3) or ldap_initialize(3). (The ldap_initialize(3) routine is preferred, but is not part of the draft specification.)"

Here are the man pages from openldap:
http://www.openldap.org/software/man.cgi?query=ldap_initialize&apropos=0&sektion=0&manpath=OpenLDAP+2.X-Devel&format=html

As you can see, they are not perfectly interchangable, but it would not be the end of the world if the consensus is to go back to init. I vote to stay with initialize for the following reasons:

1) It's working and has been thoroughly tested.(See previous posts by myself.)
2) It is the recommended method to use. I like that it has the error return code to confirm a successful connection.
3) With Brainshare coming up, I'm pretty booked until April, so I don't have much time to rewrite this.

Just my two cents.



By: Patrick Cole (ltd) 2007-03-10 03:51:22.000-0600

I had to modify my version of res_config_ldap to accept a "uri' parameter isntead of host/port as I use LDAPS.    Anyone with any security sense uses ldaps so I think it's necessary to use ldap_initialise() to accept this uri format.

By: nimhs (nimhs) 2007-03-15 06:35:13

Hi, i'm using this driver to connect asterisk with openxchange ldap database.
It work fine with plain password. But with md5 password (md5secret field), when a client want to register, no authentification was required by the server.
So, i've edited res_config_ldap.c and i've juste change it like that:
l.386
- int is_realmed_password_attribute = strcasecmp(attribute_name, "md5secret") == 0;
+ int is_realmed_password_attribute = strcasecmp(attribute_name, "md5secret") == 1;

l.512
- int is_realmed_password_attribute = strcasecmp(attribute_name, "md5secret") == 0;
+ int is_realmed_password_attribute = strcasecmp(attribute_name, "md5secret") == 1;

Now md5secret field work fine...

ps: i'm using asterisk-1.4.1 and juste res_config_ldap.c from this svn

By: Russell Bryant (russell) 2007-04-03 11:14:33

I updated the branch so that it is up to date with Asterisk trunk.  I have also re-enabled "automerge" so it will get all additional changes from trunk.

By: Gavin Henry (suretec) 2007-04-03 13:47:27

Excellent. We're going to be doing some heaving testing next week with 2.3.35 and 2.4.4alpha OpenLDAP.

Gavin.

By: Gavin Henry (suretec) 2007-04-29 14:11:46

Evening, what is stopping this now from being in core? Approval from Digium, a client to request it? Test results or code review?

What if I said I can get the main guys behind OpenLDAP to review the libldap side of things and give it a stamp of approval?

I want this core! ;-)

Gavin.

By: Russell Bryant (russell) 2007-04-30 14:24:55

Positive test reports will help more than anything else.  The more test reports I see, the more I will be willing to merge this without actually setting it up and testing it myself.  This isn't exactly the easiest thing to set up and test, so I would really rather not have to.  :)

In addition to that, I just need to make the time to do some basic code review to make sure everything meets our standards and guidelines.

By: Carl Thorner (cthorner) 2007-05-02 19:58:15

nimhs:

I was looking at the md5secret issue. Switching the logic on the is_realmed_password will work but is not a solution that really makes sense. If you do not have any other attributes where you have {md5} in the first five letters it should be ok, but you cannot guarantee that. I think your problem is in your configuration mapping (i.e., in res_ldap.conf).

By: Bart De Deckere (the sheriff) 2007-05-14 17:39:42

I tested the latest revision from the branch, but now it won't even run past make with a lot of errors.
If i do LIBS=-lldap, export LIBS before ./configure, it won't even run past ./configure.
Any thoughts?

By: Carl Thorner (cthorner) 2007-05-14 17:43:47

Hi Sheriff:

Have you ever managed to compile it, and what sort of errors are you getting?

By: Russell Bryant (russell) 2007-05-15 10:32:02

The branch compiles for me just fine.

Also, for those testing this, note that I made a change to the configuration.  When mapping attributes in res_ldap.conf, instead of having something like:

attribute = filename => PBXConfigFilename

It is now simply:

filename = PBXConfigFilename

By: Caio Zanolla (zanolla) 2007-05-16 10:53:54

svn checked out today:

when typing sip show "TAB", cli gets unresponsive.
also there are random lockups that didnt happen on svn from 2 weeks ago.
after some time asterisk hangs badly needing a kill -9

added these to modules.conf to try to pinpoint.

noload => chan_skinny.so
noload => res_snmp.so
noload => cdr_addon_mysql.so
noload => res_config_mysql.so
noload => res_config_ldap.so

no go, still hangs...

Update:

rolled back to svn checkout from 2007-05-07 and it works flawlessly...
something broke in the last 2 weeks...



By: Nito Martinez (nito) 2007-05-19 04:34:39

I've added a patch to subversion Revision: 65232 which fixes:

1) Fix reconnect bug. To reproduce create a sip map, connect as your sip user, restart the ldap server, and try to reconnect with your sip user (it fails).

Fix:

Correctly check for the result in the ldap_search operations (among other things if you restart the ldap server the connection is not reestablished). Before it was checking for ldap_search result < 0. The correct checking is for result != 0.
Please check the ldap_search and ldap_result man pages.

2)./bootstrap script. Changes in the file so that bootstrap.sh will correctly generate the configure file and include the res_config_ldap.c in the compilation



By: Bart De Deckere (the sheriff) 2007-05-29 17:11:07

Tried again today and it worked. :)
The problem I had had something to do with the LDAP library files.
I will do some more testing later this week.

By: snaker (snaker) 2007-05-29 17:52:55

I get segmentation fault when peer try register,

this is debug log:

[May 29 22:51:11] DEBUG[28666] chan_sip.c: Allocating new SIP dialog for ehokfjvtsmkezyp@87.218.150.107 - REGISTER (No RTP)
[May 29 22:51:11] DEBUG[28666] chan_sip.c: **** Received REGISTER (2) - Command in SIP REGISTER
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: substituted: string: 'dc=tarancon' => 'dc=tarancon'
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: basedn: 'dc=tarancon' => 'dc=tarancon'
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: Everything seems fine.
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: name='name' value='antonio'
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: name LDAP value: antonio
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: loginShell LDAP value: /bin/bash
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: shadowMin LDAP value: -1
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: shadowMax LDAP value: 999999
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: shadowWarning LDAP value: 7
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: shadowInactive LDAP value: -1
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: shadowExpire LDAP value: -1
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: shadowFlag LDAP value: 0
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: top
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: person
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: posixAccount
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: shadowAccount
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: inetOrgPerson
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: organizationalPerson
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: mozillaOrgPerson
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: jabberUser
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: astSipUser
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: astSipPeer
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: astSipGeneric
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: astVoicemail
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: oxyPBXExtension
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: objectClass LDAP value: CourierMailAccount
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: displayName LDAP value: antonio
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: givenName LDAP value: anton
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: cn LDAP value: anton garcia
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: postalAddress LDAP value: Luciernaga 3
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: l LDAP value: Madrid
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: postalCode LDAP value: 28032
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: st LDAP value: Madrid
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: c LDAP value: Espa?a
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: homePhone LDAP value: 913335555
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: telephoneNumber LDAP value: 1023
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: workUrl LDAP value: locolandia.ath.cx
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: jid LDAP value: anton@grupo.com
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: oxyPBXExtensionApplication LDAP value: Macro
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: oxyPBXExtensionContext LDAP value: default
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: oxyPBXExtensionPriority LDAP value: 1
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: astVoicemailContext LDAP value: default
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: host LDAP value: dynamic
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: astUsername LDAP value: antonio
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: context LDAP value: grupo
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: sn LDAP value: anton garcia
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: LINE(295) attribute_name: md5secret LDAP value: {md5}3165531613c89fc6e8ac1ca8631a0f37
[May 29 22:51:11] DEBUG[28666] res_config_ldap.c: md5: 3165531613c89fc6e8ac1ca8631a0f37

sorry if it is not important details



By: Russell Bryant (russell) 2007-06-01 15:53:52

I am unassigning this from myself so that any other developer may take this on for testing and getting the code into shape for merging if they would like to.

By: Gavin Henry (suretec) 2007-06-02 18:50:51

No one taking this yet?

By: Bart De Deckere (the sheriff) 2007-06-05 17:55:34

When i start Asterisk in debug mode (asterisk -d) i receive the following error:

WARNING[3617]: res_config_ldap.c:1526 ldap_reconnect: bind failed: Protocol error
WARNING[3617]: res_config_ldap.c:1344 load_module: Couldn't establish connection. Check debug.
NOTICE[3617]: config.c:1172 ast_config_engine_register: Registered Config Engine ldap

All the settings in the config files are pointing to the right OpenLDAP database (slapd 2.3.30-5 on Debian 4.0r0).

Any thoughts?

By: Guillaume Pujol (pic0) 2007-06-13 10:55:52

some bugs concerning the config file res_ldap.conf, section [_general]:
 * if you don't specify a port number for the LDAP server, then the module outputs "No directory port found, using 389 as default." to the logs. That's fine. But if you add a line "port=389" in the config file, then there is a bug when handling the ldap server url. Only the first character from the "host" parameter is kept. (e.g if host=LDAP.mydomain.tld and port=389, then asterisk will try to bind to ldap://L:389 instead of ldap://LDAP.mydomain.tld:389)

Here's the faulty piece of code (line 1445+ in res_config_ldap.c).

if (!(s = ast_variable_retrieve(config, "_general", "port"))) {
               ast_log(LOG_WARNING, "No directory port found, using 389 as default.\n");
               port = 389;
               ast_copy_string(host + strlen(host), ":389", sizeof(host));
       } else {
               ast_copy_string(host + 1, ":", sizeof(s));
               ast_copy_string(host + strlen(host), s, sizeof(s));
               port = atoi(s);
       }

   * the line protocol=x which should allow the user to specify the LDAP protocol version to use (2 or 3) does nothing. There is no code in res_config_ldap.c to handle this line. Consequently, asterisk always uses LDAPv2.

Regards,

By: Mario K (anyc) 2007-06-25 08:16:48

Hi,
I've written the following patch to handle the protocol statement in the res_ldap.conf

--- res/res_config_ldap.c       (revision 71518)
+++ res/res_config_ldap.c       (working copy)
@@ -65,6 +65,7 @@
static char user[512];
static char pass[50];
static char basedn[512];
+static int protocol_version = 3;
static int port = 389;
static time_t connect_time;

@@ -1451,6 +1452,12 @@
               ast_copy_string(host + strlen(host), s, sizeof(s));
               port = atoi(s);
       }
+
+       if (!(s = ast_variable_retrieve(config, "_general", "protocol"))) {
+               ast_log(LOG_WARNING, "No protocol version found, using v3 as default.\n");
+       } else {
+               protocol_version = atoi(s);
+       }

       table_configs_free();

@@ -1506,6 +1513,7 @@
               return 0;
       }

+       ldap_set_option(ldapConn, LDAP_OPT_PROTOCOL_VERSION, &protocol_version);
       if (!ast_strlen_zero(user)) {
               if (option_debug > 1)
                       ast_log(LOG_DEBUG, "bind to %s as %s\n", host, user);

By: Carl Thorner (cthorner) 2007-06-25 16:23:25

russell:

Is anyone taking on this project? If not, then I don't mind taking lead on this. Does it have to be someone from Digium? I have a few more changes critical changes I'd like to include before we complete the merge, but they are still in testing/development. Can we get this into the 1.4 branch? If not, then when is the deadline for 1.6 and can we create a 1.6 branch?

By: Russell Bryant (russell) 2007-06-26 22:06:25

cthorner:  Nobody is currently working on this as far as I know.  If you would like to take it on, that would be great.  Just drop me an email when you have patches that need to be applied for now.  Keep in mind that all changes that go in must come from a contributor that has a license agreement (disclaimer) on file with Digium.  If you are willing to do some coding on this, I will go back and look at the code to see if I can explain some of the things that I still would like to see changed.

Also, there is not yet a deadline for merging features for Asterisk 1.6.  I don't expect it to happen anytime soon.

By: Carl Thorner (cthorner) 2007-06-27 11:07:07

russell:

Ok, done deal. I do have a disclaimer on file from when I added patch res_config_ldap.c-svn-diff-50465 to move to the latest version of ldap and asterisk 1.4. I will be working on the new patch in July and should have something ready and tested before Linux World.

By: Guillaume Pujol (pic0) 2007-07-02 03:13:04

cthorner: as a potentially interested user, I am available for testing patches.
Happy coding :)

By: Jason Parker (jparker) 2007-07-03 13:12:15

pic0, please don't post patches in bug notes.  It is best to upload them as files.

By: Gavin Henry (suretec) 2007-07-13 08:14:22

Is svn up to date with all the latest patches?

By: Gavin Henry (suretec) 2007-07-13 10:19:02

Hi All,

I've uploaded a proper res_ldap.conf example to tie in with the correct attribute names (AstConfig* etc.) and uploaded a new schema.

Has anyone else got the latest svn to run? It compiles ok, but it doesn't appear to be getting linked correctly:

asterisk: symbol lookup error: /usr/lib/asterisk/modules/res_config_ldap.so: undefined symbol: ldap_initialize

Our disclaimer is already on file, but we just had to do an online one to upload these files?

Gavin.

By: Gavin Henry (suretec) 2007-07-13 13:17:24

Uploaded correct file. Once we get an up to date svn, I'll do a svn diff etc.

Gavin.

By: Gavin Henry (suretec) 2007-07-13 13:23:03

The namespace in doc/ldap.txt and the schema seem inconsistent. in ldap.txt we talk about AstAccountSIP, but in the schema we have AsteriskSIPUser.

Shall we stick to Ast* throughout the namespace?

Gavin.

By: Gavin Henry (suretec) 2007-07-13 13:24:27

Attributes are fine, just Objectclasses seem wrong.

By: Gavin Henry (suretec) 2007-07-13 13:25:35

Ignore my symbol error message before, I never did:

export LIBS=-lldap

Shouldn't this be done in the Makefile etc.

Gavin.

By: Russell Bryant (russell) 2007-07-17 09:54:56

previous uploads with license problems have been deleted, you should be able to upload now

By: Gavin Henry (suretec) 2007-07-19 07:46:28

asterisk-v3.1.schema

Small typo.

By: Gavin Henry (suretec) 2007-07-19 07:51:03

I think the objectclasses should stay as:

AsteriskExtension
AsteriskIAXUser
AsteriskSIPUser

And keep the namespace for attribute as Ast*

Nice and clear that way.

By: Gavin Henry (suretec) 2007-07-19 09:55:53

Added latest schema in LDIF format.

By: Gavin Henry (suretec) 2007-07-19 14:50:14

New objectclass added that was missing for config values etc.

By: Gavin Henry (suretec) 2007-07-20 04:42:59

Latest schemas uploaded.

By: Nito Martinez (nito) 2007-07-20 05:25:18

SureTec, I think asterisk-v3.1.2.schema   should become asterisk-v3.1.3.schema  

with the following change:

objectIdentifier AsteriskConfig AstObjectClass:4

Before it was objectIdentifier AsteriskConfig AstObjectClass:3

which lead to duplicate OIDs:

/etc/ldap/schema/asterisk-v3.1.2.schema: line 563: Inconsistent duplicate objectClass: "1.3.6.1.4.1.22736.5.2.3"

By: Gavin Henry (suretec) 2007-07-20 05:37:58

Stick with the latest asterisk-v3.1.4.*

This has that typo fixed and a new objectClass (AsteriskConfig) and attributes:

AstConfig*

This version has been heavily tested (8hrs yesterday).

By: Gavin Henry (suretec) 2007-07-23 10:15:58

Hi,

Is anyone going to take control of the commits and merge/patch some of this stuff?

I've got to really cobble it all to get an up to date working system.

Gavin.

By: Digium Subversion (svnbot) 2007-07-23 10:45:08

Repository: asterisk
Revision: 76610

------------------------------------------------------------------------
r76610 | russell | 2007-07-23 10:45:06 -0500 (Mon, 23 Jul 2007) | 1 line

get branch for issue ASTERISK-5620 and re-enable automerge
------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-07-23 10:58:09

Repository: asterisk
Revision: 76611

------------------------------------------------------------------------
r76611 | russell | 2007-07-23 10:58:08 -0500 (Mon, 23 Jul 2007) | 7 lines

(issue ASTERISK-5620)
Patches:
     asterisk-v3.1.4.ldif uploaded by suretec (license 70)
     asterisk-v3.1.4.schema uploaded by suretec (license 70)

Add ldif, and add updated schema

------------------------------------------------------------------------

By: Gavin Henry (suretec) 2007-07-31 05:40:51

Great thanks!

We'll re-test with the new commits.

Is the code now up to date too?

By: Russell Bryant (russell) 2007-07-31 08:01:25

The code is up to date to the best of my knowlege, yes.  There is one patch on here that I don't think I applied, but it is a small one.

nito:  Can you verify if you had a license agreement (disclaimer) on file with Digium at the time that you uploaded your patch?

By: Digium Subversion (svnbot) 2007-07-31 08:22:25

Repository: asterisk
Revision: 77813

------------------------------------------------------------------------
r77813 | russell | 2007-07-31 08:22:23 -0500 (Tue, 31 Jul 2007) | 1 line

ensure branch is up to date for issue ASTERISK-5620
------------------------------------------------------------------------

By: Nito Martinez (nito) 2007-07-31 09:02:38

Not that I'm aware of, so that means probably not.

In any case, feel free to use the patch, the only important part is to reestablish the connection in case the ldap server fails.

By: Carl Thorner (cthorner) 2007-08-01 11:51:45

Are we really hardcoding reestablishing the LDAP link into the res_config_ldap.c code? My feeling is that that is more of an application/network management layer feature.

By: Nito Martinez (nito) 2007-08-01 13:20:43

Well, I think it is a matter of opinions, but at the current state if the LDAP server restarts asterisk does not reestablish the connection (for openldap, I think you need to stop the database to have a consistent backup).

In any case the testing code (and rebind) is already implemented. See below:

result = ldap_search_ext_s(...);
if (result < 0 && is_ldap_connect_error(result)) {

But the error checking is wrong the correct ldap check is

if (result != 0 && is_ldap_connect_error(result)) {

(or sjmilarly correctly)

if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {

please see the return for ldap_search(3) that is documented in ldap_error(3) (man pages) and the relevant LDAP_SUCCESS and other errors in /usr/include/ldap.h (for example the error LDAP_OPERATIONS_ERROR has a value of 1 and would not be included in the first check).

(all this for the openldap version, although the ldap codes come from the RFC 2251, http://tools.ietf.org/html/rfc2251#section-4.1.10)

By: Gavin Henry (suretec) 2007-08-01 14:15:33

OpenLDAP doesn't need to be shutdown for slapcat (backup).

I would prefer a reconnect instead of restarting Asterisk.

By: Carl Thorner (cthorner) 2007-08-02 18:01:41

Looks like the changes russell made took care of the bug I was worried about - nice. I have done some testing and rolled the latest version out to our QA lab. So far everything looks good!

By: Sergey Tamkovich (sergee) 2007-08-03 01:12:32

My 2c: You are using outdated realtime API. New version of RT API contains also "store_func" and "destroy_func" (see issue 8118). It would be nice if you implement it aswell. Thanks!

By: Tilghman Lesher (tilghman) 2007-08-30 16:58:17

Updated branch to latest trunk.  Is this waiting on anything else or is this a candidate to be merged to trunk?

By: Gavin Henry (suretec) 2007-08-30 17:05:53

cthorner had some updates to apply he said and then there's the new RealTime API to consider?

Gavin.

By: Gavin Henry (suretec) 2007-08-30 17:07:00

I'd also like LIBS=-lldap to be in the right place.

By: ax (axrusso) 2007-09-05 07:12:06

Hi to all. I'm new...
I'm looking for the README, I'd like to add this feature to my asterisk 1.4, where is the README for res_config_ldap???

By: Gavin Henry (suretec) 2007-09-06 13:34:31

Try:

doc/ldap.txt
configs/res_ldap.conf.sample

By: Gustavo Higa (ghm1014) 2007-11-02 16:43:43

I tried to compile res_config_ldap.c from http://svn.digium.com/view/asterisk/team/group/res_config_ldap into Asterisk 1.4.12.1 (last stable on this time) but I couldn't. Then I downloadded  res_config_ldap.c.0.9 and res_config_ldap.c.patch from this page and tried it. I successfuly compiled it but the module makes asterisk crash when it starts withouth any message.

By: Nito Martinez (nito) 2007-11-08 03:45:06.000-0600

Hi,

could we add the module information into res_config_ldap.c?

Currently it is

/*** MODULEINFO
***/


but I think it should be (this would allow when you rebuild everything to use -lldap )

/*** MODULEINFO
    <depend>ldap</depend>
***/

By: Nito Martinez (nito) 2007-11-28 14:58:16.000-0600

Hi all,

I've just uploaded res_config_ldap_patch_svn_90039.patch which applies to the subversion revision 90039.

Bugs fixed:
1) Old. Ldap reconnecttion (see elsewhere in this bug report, id = 0068223)
2) Old. Module requirement (see elsewhere in this bug report, id = 0073368)
3) New. Fix in the extensions module. The change is basically:

       ast_debug(2, "name='%s' value='%s'\n", name, value);

       if (like_pos) {
-               name = new_name = ast_strdupa(like_pos + strlen(" LIKE"));
+               name = new_name = ast_strndup(name, strlen(name) - strlen("LIKE"));
               value = new_value = ast_strdupa(value);
               replace_string_in_string(new_value, "\\_", "_");
               replace_string_in_string(new_value, "%", "*");

The old line does not what is intended and (which is basically assign to to name the string "exten" whenever the you do a an "exten LIKE" partial match.

This yielded in the following error during in the asterisk logs (external symptom, please see that the attribute exten is not mapped to AstExtension):

[Nov 25 10:11:39] WARNING[14599] res_config_ldap.c: Failed to query database. Check debug for more info.
[Nov 25 10:11:39] WARNING[14599] res_config_ldap.c: Query: (&(objectClass=AsteriskExtension)(=_*)(AstContext=sipclients)(AstPriority=1))
[Nov 25 10:11:39] WARNING[14599] res_config_ldap.c: Query Failed because: Bad search filter

By: Nito Martinez (nito) 2007-12-04 01:30:38.000-0600

Hi,

could the owner of this branch recheck the license of the res_config_ldap_patch_svn_90039.patch?

By: Faraz Khan (fkhan) 2007-12-10 02:34:37.000-0600

Just adding my results: Asterisk SVN-group-res_config_ldap-r81399M-/trunk works perfectly fine when using with sipusers,sippeers,iax and extensions (with the Realtime Switch in dialplan)

However, using realtime for sip.conf or extensions.conf through a mysterious 'No Variable Metric for ?' error. From the code it seems as if it is trying to read a ldap parameter var_metric which doesnt exist in the schema or res_config_ldap.conf

At any rate- having sipusers,sippeers and extensions is excellent! Thanks a lot! .conf files are pretty static anyways. Hope this makes it to 1.4

By: Digium Subversion (svnbot) 2008-01-15 17:21:38.000-0600

Repository: asterisk
Revision: 12468

U   team/oej/test-this-branch/README.test-this-branch
A   team/oej/test-this-branch/configs/res_ldap.conf.sample
A   team/oej/test-this-branch/doc/rt-ldap.txt
U   team/oej/test-this-branch/res/Makefile
A   team/oej/test-this-branch/res/res_config_ldap.c

------------------------------------------------------------------------
r12468 | oej | 2008-01-15 17:21:38 -0600 (Tue, 15 Jan 2008) | 2 lines

Issue ASTERISK-5620 - Realtime LDAP driver. (mguesdon)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=12468

By: Digium Subversion (svnbot) 2008-01-15 17:21:43.000-0600

Repository: asterisk
Revision: 12474

_U  team/oej/res_config_ldap/
A   team/oej/res_config_ldap/configs/res_ldap.conf.sample
A   team/oej/res_config_ldap/doc/rt-ldap.txt
U   team/oej/res_config_ldap/res/Makefile
A   team/oej/res_config_ldap/res/res_config_ldap.c

------------------------------------------------------------------------
r12474 | oej | 2008-01-15 17:21:43 -0600 (Tue, 15 Jan 2008) | 2 lines

Adding patch from issue ASTERISK-5620 with some formatting changes.

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=12474

By: Gavin Henry (suretec) 2008-01-21 05:56:02.000-0600

Any chance of this getting into a 1.6 beta/rc release?

Thanks.

By: Carl Thorner (cthorner) 2008-01-21 12:06:18.000-0600

I would like to see it make it into 1.6 but this branch is based on 1.4. Could somebody update that? Also, how much time do we have for testing to make that happen? I think the code has been tested extensively in the 1.4 branch but not in the 1.6.

By: Gavin Henry (suretec) 2008-01-21 14:02:20.000-0600

I just don't understand why this isn't getting jumped on. Who seriously doesn't won't to run a PABX etc. and have the info in a directory server?

By: Anthony LaMantia-2 (anthonyl) 2008-01-22 14:48:43.000-0600

If LDAP support is critical for you, it may be prudent to take a look at freeswitch ( http://wiki.freeswitch.org/wiki/FreeSwitch_Dialplan_Directory ) and consider integrating it with asterisk in your setup.

By: Tilghman Lesher (tilghman) 2008-01-22 15:23:38.000-0600

suretec:  have you tested the branch http://svn.digium.com/view/asterisk/team/group/res_config_ldap/ ?  If so, does it work for you?

By: Gavin Henry (suretec) 2008-01-22 15:28:36.000-0600

Yes, it works using the schema I did above.

By: Tilghman Lesher (tilghman) 2008-01-22 15:39:33.000-0600

Okay, so for committing this, I need to merge the branch and add asterisk-v3.1.4.ldif and asterisk-v3.1.4.schema to the contrib directory.  Is there anything that I'm missing here?

By: Gavin Henry (suretec) 2008-01-22 15:46:26.000-0600

The docs; readme and sample .conf

By: Digium Subversion (svnbot) 2008-01-22 16:30:43.000-0600

Repository: asterisk
Revision: 99696

_U  trunk/
U   trunk/CHANGES
U   trunk/build_tools/menuselect-deps.in
A   trunk/configs/res_ldap.conf.sample
U   trunk/configure
U   trunk/configure.ac
A   trunk/contrib/scripts/asterisk.ldap-schema
A   trunk/contrib/scripts/asterisk.ldif
A   trunk/doc/ldap.txt
U   trunk/include/asterisk/autoconfig.h.in
U   trunk/makeopts.in
A   trunk/res/res_config_ldap.c

------------------------------------------------------------------------
r99696 | tilghman | 2008-01-22 16:30:42 -0600 (Tue, 22 Jan 2008) | 10 lines

Add res_config_ldap for realtime LDAP engine.
(closes issue ASTERISK-5620)
Reported by: mguesdon
Patches:
      res_config_ldap-v0.7.tar.gz uploaded by mguesdon (license 121)
      res_ldap.conf.sample uploaded by suretec (license 70)
      asterisk-v3.1.4.ldif uploaded by suretec (license 70)
      asterisk-v3.1.4.schema uploaded by suretec (license 70)
Tested by: oej, mguesdon, suretec, cthorner

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=99696

By: Digium Subversion (svnbot) 2008-01-23 07:20:27.000-0600

Repository: asterisk
Revision: 99859

_U  team/murf/bug11210/
U   team/murf/bug11210/CHANGES
U   team/murf/bug11210/apps/app_voicemail.c
U   team/murf/bug11210/build_tools/menuselect-deps.in
U   team/murf/bug11210/channels/chan_sip.c
A   team/murf/bug11210/configs/cli.conf.sample
A   team/murf/bug11210/configs/res_ldap.conf.sample
U   team/murf/bug11210/configure
U   team/murf/bug11210/configure.ac
A   team/murf/bug11210/contrib/scripts/asterisk.ldap-schema
A   team/murf/bug11210/contrib/scripts/asterisk.ldif
A   team/murf/bug11210/doc/ldap.txt
U   team/murf/bug11210/doc/tex/channelvariables.tex
U   team/murf/bug11210/include/asterisk/autoconfig.h.in
U   team/murf/bug11210/include/asterisk/channel.h
U   team/murf/bug11210/main/acl.c
U   team/murf/bug11210/main/asterisk.c
U   team/murf/bug11210/main/channel.c
U   team/murf/bug11210/makeopts.in
A   team/murf/bug11210/res/res_config_ldap.c
U   team/murf/bug11210/res/res_odbc.c

------------------------------------------------------------------------
r99859 | murf | 2008-01-23 07:20:24 -0600 (Wed, 23 Jan 2008) | 149 lines

Merged revisions 99642,99644-99647,99653,99696,99700,99719,99758,99776,99778,99818,99839 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r99642 | russell | 2008-01-22 13:33:16 -0700 (Tue, 22 Jan 2008) | 3 lines

Change the Asterisk CLI startup commands feature to read commands to run from cli.conf
after a discussion on the -dev list.

................
r99644 | oej | 2008-01-22 13:35:10 -0700 (Tue, 22 Jan 2008) | 18 lines

Add a generic function to set the bridged call PVT unique id string
as a channel variable BRIDGEPVTCALLID

This is important for call tracing in log files and CDRs, so that
the SIP callID can be traced along servers.

The CHANNEL dialplan function won't work here, since the outbound
channel is gone when we need the Call-ID.

Other channel drivers may now implement the same function :-),
but this patch only supports chan_sip.so.

Inspired by (issue ASTERISK-11279)
Reported by: ctooley

Patch by oej


................
r99645 | russell | 2008-01-22 13:41:05 -0700 (Tue, 22 Jan 2008) | 2 lines

Make sure the command is not just present but is also configured to be executed

................
r99646 | tilghman | 2008-01-22 13:42:47 -0700 (Tue, 22 Jan 2008) | 10 lines

Merged revisions 99643 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99643 | tilghman | 2008-01-22 14:34:55 -0600 (Tue, 22 Jan 2008) | 2 lines

Fix the defines for OS X (and Solaris, too)

........

................
r99647 | oej | 2008-01-22 13:44:56 -0700 (Tue, 22 Jan 2008) | 2 lines

Documentation updates for BRIDGEPVTCALLID

................
r99653 | oej | 2008-01-22 14:09:37 -0700 (Tue, 22 Jan 2008) | 12 lines

Merged revisions 99652 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99652 | oej | 2008-01-22 21:56:09 +0100 (Tis, 22 Jan 2008) | 4 lines

Thanks to Russell's education I realize that BUFSIZ has changed since I learned the C language
over 20 years ago... Resetting chan_sip to the size of BUFSIZ that I expected in my old
head to avoid too heavy memory allocations on some systems.

........

................
r99696 | tilghman | 2008-01-22 15:33:20 -0700 (Tue, 22 Jan 2008) | 10 lines

Add res_config_ldap for realtime LDAP engine.
(closes issue ASTERISK-5620)
Reported by: mguesdon
Patches:
      res_config_ldap-v0.7.tar.gz uploaded by mguesdon (license 121)
      res_ldap.conf.sample uploaded by suretec (license 70)
      asterisk-v3.1.4.ldif uploaded by suretec (license 70)
      asterisk-v3.1.4.schema uploaded by suretec (license 70)
Tested by: oej, mguesdon, suretec, cthorner

................
r99700 | tilghman | 2008-01-22 17:10:45 -0700 (Tue, 22 Jan 2008) | 2 lines

Oops

................
r99719 | tilghman | 2008-01-22 18:06:27 -0700 (Tue, 22 Jan 2008) | 10 lines

Merged revisions 99718 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99718 | tilghman | 2008-01-22 18:56:06 -0600 (Tue, 22 Jan 2008) | 2 lines

Just confirmed that all current platforms need this header file

........

................
r99758 | tilghman | 2008-01-22 20:57:31 -0700 (Tue, 22 Jan 2008) | 2 lines

Coding guidelines cleanup

................
r99776 | tilghman | 2008-01-22 21:25:33 -0700 (Tue, 22 Jan 2008) | 10 lines

Merged revisions 99775 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99775 | tilghman | 2008-01-22 22:20:15 -0600 (Tue, 22 Jan 2008) | 2 lines

Oops, should have checked for a NULL obj, here, too

........

................
r99778 | tilghman | 2008-01-22 21:35:04 -0700 (Tue, 22 Jan 2008) | 16 lines

Merged revisions 99777 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99777 | tilghman | 2008-01-22 22:31:51 -0600 (Tue, 22 Jan 2008) | 8 lines

When we reset the password via an external command, we should also reset the
password stored in the in-memory list, too (otherwise it doesn't really take
effect).
(closes issue ASTERISK-11273)
Reported by: davetroy
Patches:
      fix_externpass.diff uploaded by davetroy (license 384)

........

................
r99818 | tilghman | 2008-01-22 22:29:28 -0700 (Tue, 22 Jan 2008) | 2 lines

Coding guidelines fixups

................
r99839 | oej | 2008-01-23 03:18:13 -0700 (Wed, 23 Jan 2008) | 3 lines

- Add a few comments to sip_xmit
- Make sure that we are aware of a pending INVITE even if we're using TCP

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=99859