Index: configs/res_ldap.conf.sample
===================================================================
--- configs/res_ldap.conf.sample	(revision 379645)
+++ configs/res_ldap.conf.sample	(working copy)
@@ -1,6 +1,5 @@
-;
 ; Configuration file for res_config_ldap
-;
+; https://wiki.asterisk.org/wiki/display/AST/LDAP+Realtime+Driver
 
 ; Realtime configuration
 ; ----------------------
@@ -14,8 +13,10 @@
 ; In the case of LDAP the last keyword in each line above specifies
 ; a section in this file.
 ;
-; LDAP schema and ldif files can be located in contrib/scripts.
+; LDAP schema and ldif files can be located in contrib/scripts/
 
+; Write access to the LDAP service is required by res_config_ldap.
+
 ; TLS support
 ; -----------
 ; Note that you can configure an ldaps: url here to get TLS support.
@@ -26,9 +27,13 @@
 ; *********************************************************************************
 ; NOTE: res_ldap.conf should be chmod 600 because it contains the plain-text LDAP
 ;       password to an account with WRITE access to the asterisk configuration. 
+;
+; NOTE: Secret/Password can be an MD5 hash. Field value is appended with {md5}.
+;       Generate the password via the md5sum command.
+;       printf "my_password" | md5sum
 ; *********************************************************************************
 
-[_general]
+[general]
 ;
 ; Specify one of either host and port OR url.  URL is preferred, as you can
 ; use more options.
@@ -63,64 +68,62 @@
 ; Extensions Table
 ;
 [extensions]
-context  =  AstExtensionContext
-exten  =  AstExtensionExten
-priority = AstExtensionPriority
-app = AstExtensionApplication
-appdata = AstExtensionApplicationData
-additionalFilter=(objectClass=AstExtension)
+context = AstContext
+exten = AstExtension
+priority = AstPriority
+app = AstApplication
+appdata = AstApplicationData
+additionalFilter=(objectClass=AsteriskExtension)
 
 ;
 ; Sip Users Table
 ;
 [sip]
-name = cn       ; We use the "cn" as the default value for name on the line above
-                ; because objectClass=AsteriskSIPUser does not include a uid as an allowed field
-                ; If your entry combines other objectClasses and uid is available, you may
-                ; prefer to change the line to be name = uid, especially if your LDAP entries
-                ; contain spaces in the cn field.
-                ; You may also find it appropriate to use something completely different.
-                ; This is possible by changing the line above to name = AstAccountName (or whatever you
-                ; prefer).
-                ;
+name = cn
+; We use the "cn" as the default value for name on the line above
+; because objectClass=AsteriskSIPUser does not include a uid as an allowed field
+; If your entry combines other objectClasses and uid is available, you may
+; prefer to change the line to be name = uid, especially if your LDAP entries
+; contain spaces in the cn field.
+; You may also find it appropriate to use something completely different.
+; This is possible by changing the line above to name = AstAccountName (or whatever you
+; prefer).
+
+allow = AstAccountAllowedCodec
 amaflags = AstAccountAMAFlags
+callerid = AstAccountCallerID
 callgroup = AstAccountCallGroup
-callerid = AstAccountCallerID
+cancallforward = AstAccountCanCallForward
+context = AstAccountContext
+defaultuser = AstAccountDefaultUser
+deny = AstAccountDeny
 directmedia = AstAccountDirectMedia
-context = AstAccountContext
+disallow = AstAccountDisallowedCodec
 dtmfmode = AstAccountDTMFMode
+fromdomain = AstAccountFromDomain
 fromuser = AstAccountFromUser
-fromdomain = AstAccountFromDomain
 fullcontact = AstAccountFullContact
-fullcontact = gecos
 host = AstAccountHost
 insecure = AstAccountInsecure
+ipaddr = AstAccountIPAddress
+lastms = AstAccountLastQualifyMilliseconds
 mailbox = AstAccountMailbox
-md5secret = AstAccountRealmedPassword           ; Must be an MD5 hash. Field value can start with
-                                                ; {md5} but it is not required.
-                                                ; Generate the password via the md5sum command, e.g.
-                                                ; echo "my_password" | md5sum
+md5secret = AstMD5secret
+musiconhold = AstAccountMusicOnHold
 nat = AstAccountNAT
-deny = AstAccountDeny
 permit = AstAccountPermit
 pickupgroup = AstAccountPickupGroup
 port = AstAccountPort
 qualify = AstAccountQualify
+regcontext = AstAccountRegistrationContext
+regexten = AstAccountRegistrationExten
+regseconds = AstAccountExpirationTimestamp
+regserver = AstAccountRegistrationServer
 restrictcid = AstAccountRestrictCID
+rtpholdtimeout = AstAccountRTPHoldTimeout
 rtptimeout = AstAccountRTPTimeout
-rtpholdtimeout = AstAccountRTPHoldTimeout
 type = AstAccountType
-disallow = AstAccountDisallowedCodec
-allow = AstAccountAllowedCodec
-MusicOnHold = AstAccountMusicOnHold
-regseconds = AstAccountExpirationTimestamp
-regcontext = AstAccountRegistrationContext
-regexten = AstAccountRegistrationExten
-CanCallForward = AstAccountCanCallForward
-ipaddr = AstAccountIPAddress
-defaultuser = AstAccountDefaultUser
-regserver = AstAccountRegistrationServer
-lastms = AstAccountLastQualifyMilliseconds
+useragent = AstAccountUserAgent
 additionalFilter=(objectClass=AsteriskSIPUser)
 
 ;
@@ -134,10 +137,7 @@
 fullcontact = gecos
 host = AstAccountHost
 mailbox = AstAccountMailbox
-md5secret = AstAccountRealmedPassword           ; Must be an MD5 hash. Field value can start with
-                                                ; {md5} but it is not required.
-                                                ; Generate the password via the md5sum command, e.g.
-                                                ; echo "my_password" | md5sum
+md5secret = AstMD5secret
 deny = AstAccountDeny
 permit = AstAccountPermit
 port = AstAccountPort
@@ -150,6 +150,7 @@
 regexten = AstAccountRegistrationExten
 notransfer = AstAccountNoTransfer
 lastms = AstAccountLastQualifyMilliseconds
+useragent = AstAccountUserAgent
 additionalFilter=(objectClass=AstAccountIAX)
 
 ;
@@ -173,10 +174,7 @@
 host = AstAccountHost
 insecure = AstAccountInsecure
 mailbox = AstAccountMailbox
-md5secret = AstAccountRealmedPassword           ; Must be an MD5 hash. Field value can start with
-                                                ; {md5} but it is not required.
-                                                ; Generate the password via the md5sum command, e.g.
-                                                ; echo "my_password" | md5sum
+md5secret = AstMD5secret
 nat = AstAccountNAT
 deny = AstAccountDeny
 permit = AstAccountPermit
@@ -189,10 +187,56 @@
 type = AstAccountType
 disallow = AstAccountDisallowedCodec
 allow = AstAccountAllowedCodec
-MusicOnHold = AstAccountMusicOnHold
+musiconhold = AstAccountMusicOnHold
 regseconds = AstAccountExpirationTimestamp
 regcontext = AstAccountRegistrationContext
 regexten = AstAccountRegistrationExten
-CanCallForward = AstAccountCanCallForward
+cancallcorward = AstAccountCanCallForward
 additionalFilter=(objectClass=AstAccount)
 
+[queue]
+announce=AstQueueAnnounce
+announce_frequency=AstQueueFrequency
+announce_holdtime=AstQueueAnnounceholdtime
+announce_round_seconds=AstQueueRoundseconds
+context=AstQueueContext
+eventmemberstatus=AstQueueEventmemberstatus
+eventwhencalled=AstQueueEventwhencalled
+joinempty=AstQueueJoinempty
+leavewhenempty=AstQueueLeavewhenempty
+maxlen=AstQueueMaxlen
+memberdelay=AstQueueMemberdelay
+monitor_join=AstQueueMonjoin
+monitor_format=AstQueueMonformat
+musiconhold=AstQueueMoh
+name=AstQueueName
+periodic_announce=AstQueuePeriodicannounce
+periodic_announce_frequency=AstQueuePeriodicannouncefrequency
+queue_callswaiting=AstQueueCallswaiting
+queue_holdtime=AstQueueHoldtime
+queue_lessthan=AstQueueLessthan
+queue_minutes=AstQueueMinutes
+queue_reporthold=AstQueueReporthold
+queue_seconds=AstQueueSeconds
+queue_thankyou=AstQueueThankyou
+queue_thereare=AstQueueThereare
+queue_youarenext=AstQueueYouarenext
+reportholdtime=AstQueueReportholdtime
+retry=AstQueueRetry
+servicelevel=AstQueueServicelevel
+strategy=AstQueueStrategy
+timeout=AstQueueTimeout
+timeoutrestart=AstQueueTimeoutrestart
+weight=AstQueueWeight
+wrapuptime=AstQueueWrapuptime
+additionalFilter=(objectClass=AsteriskQueue)
+
+[queue_member]
+uniqueid=AstAccountCallerID
+membername=AstQueueMembername
+queue_name=AstQueueMemberof
+interface=AstQueueInterface
+penalty=AstQueuePenality
+paused=AstQueuePaused
+additionalFilter=(objectClass=AsteriskQueueMember)
+
Index: res/res_config_ldap.c
===================================================================
--- res/res_config_ldap.c	(revision 379645)
+++ res/res_config_ldap.c	(working copy)
@@ -1628,7 +1628,7 @@
 		return -1;
 	}
 
-	if (!(s = ast_variable_retrieve(config, "_general", "user"))) {
+	if (!(s = ast_variable_retrieve(config, "general", "user"))) {
 		ast_log(LOG_NOTICE, "No directory user found, anonymous binding as default.\n");
 		user[0] = '\0';
 	} else {
@@ -1636,7 +1636,7 @@
 	}
 
 	if (!ast_strlen_zero(user)) {
-		if (!(s = ast_variable_retrieve(config, "_general", "pass"))) {
+		if (!(s = ast_variable_retrieve(config, "general", "pass"))) {
 			ast_log(LOG_WARNING, "No directory password found, using 'asterisk' as default.\n");
 			ast_copy_string(pass, "asterisk", sizeof(pass));
 		} else {
@@ -1645,10 +1645,10 @@
 	}
 
 	/* URL is preferred, use host and port if not found */
-	if ((s = ast_variable_retrieve(config, "_general", "url"))) {
+	if ((s = ast_variable_retrieve(config, "general", "url"))) {
 		ast_copy_string(url, s, sizeof(url));
-	} else if ((host = ast_variable_retrieve(config, "_general", "host"))) {
-		if (!(s = ast_variable_retrieve(config, "_general", "port")) || sscanf(s, "%5d", &port) != 1 || port > 65535) {
+	} else if ((host = ast_variable_retrieve(config, "general", "host"))) {
+		if (!(s = ast_variable_retrieve(config, "general", "port")) || sscanf(s, "%5d", &port) != 1 || port > 65535) {
 			ast_log(LOG_NOTICE, "No directory port found, using 389 as default.\n");
 			port = 389;
 		}
@@ -1660,13 +1660,13 @@
 		return -1;
 	}
 
-	if (!(s = ast_variable_retrieve(config, "_general", "basedn"))) {
+	if (!(s = ast_variable_retrieve(config, "general", "basedn"))) {
 		ast_log(LOG_ERROR, "No LDAP base dn found, using '%s' as default.\n", RES_CONFIG_LDAP_DEFAULT_BASEDN);
 		ast_copy_string(base_distinguished_name, RES_CONFIG_LDAP_DEFAULT_BASEDN, sizeof(base_distinguished_name));
 	} else 
 		ast_copy_string(base_distinguished_name, s, sizeof(base_distinguished_name));
 
-	if (!(s = ast_variable_retrieve(config, "_general", "version")) && !(s = ast_variable_retrieve(config, "_general", "protocol"))) {
+	if (!(s = ast_variable_retrieve(config, "general", "version")) && !(s = ast_variable_retrieve(config, "general", "protocol"))) {
 		ast_log(LOG_NOTICE, "No explicit LDAP version found, using 3 as default.\n");
 	} else if (sscanf(s, "%30d", &version) != 1 || version < 1 || version > 6) {
 		ast_log(LOG_WARNING, "Invalid LDAP version '%s', using 3 as default.\n", s);
@@ -1676,7 +1676,7 @@
 	table_configs_free();
 
 	while ((category_name = ast_category_browse(config, category_name))) {
-		int is_general = (strcasecmp(category_name, "_general") == 0);
+		int is_general = (strcasecmp(category_name, "general") == 0);
 		int is_config = (strcasecmp(category_name, "config") == 0); /*!< using the [config] context for Static RealTime */
 		struct ast_variable *var = ast_variable_browse(config, category_name);
 		
Index: contrib/scripts/asterisk.ldap-schema
===================================================================
--- contrib/scripts/asterisk.ldap-schema	(revision 379645)
+++ contrib/scripts/asterisk.ldap-schema	(working copy)
@@ -815,19 +815,19 @@
 	AsteriskDialplan
 	NAME 'AsteriskDialplan'
 	DESC 'Asterisk Dialplan Information'
-	SUP top STRUCTURAL
+	SUP top AUXILIARY
 	MUST ( AstExtension ) )
 
 objectClass (
 	AsteriskAccount
 	NAME 'AsteriskAccount'
 	DESC 'Asterisk Account Information'
-	SUP top STRUCTURAL
+	SUP top AUXILIARY
 	MUST ( AstAccountName ) )
 
 objectClass (
 	AsteriskMailbox
 	NAME 'AsteriskMailbox'
 	DESC 'Asterisk Mailbox Information'
-	SUP top STRUCTURAL
+	SUP top AUXILIARY
 	MUST ( AstVoicemailMailbox ) )
Index: contrib/scripts/asterisk.ldif
===================================================================
--- contrib/scripts/asterisk.ldif	(revision 379645)
+++ contrib/scripts/asterisk.ldif	(working copy)
@@ -810,7 +810,7 @@
 olcObjectClasses: ( AsteriskDialplan
     NAME 'AsteriskDialplan'
     DESC 'Asterisk Dialplan Information'
-    SUP top STRUCTURAL
+    SUP top AUXILIARY
     MUST ( 
     AstExtension
     )
@@ -819,7 +819,7 @@
 olcObjectClasses: ( AsteriskAccount
     NAME 'AsteriskAccount'
     DESC 'Asterisk Account Information'
-    SUP top STRUCTURAL
+    SUP top AUXILIARY
     MUST ( 
     AstAccountName
     )
@@ -828,7 +828,7 @@
 olcObjectClasses: ( AsteriskMailbox
     NAME 'AsteriskMailbox'
     DESC 'Asterisk Mailbox Information'
-    SUP top STRUCTURAL
+    SUP top AUXILIARY
     MUST (
     AstVoicemailMailbox
     )
