[asterisk-commits] ghenry: branch 1.6.0 r211768 - in /branches/1.6.0: ./ contrib/scripts/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 12 11:16:12 CDT 2009


Author: ghenry
Date: Wed Aug 12 11:16:07 2009
New Revision: 211768

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=211768
Log:
Merged revisions 211767 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r211767 | ghenry | 2009-08-12 17:00:46 +0100 (Wed, 12 Aug 2009) | 33 lines
  
  Added three new attributes and applied a patch to res_config_ldap.c
  
  attributetype ( AstAccountSubscribeContext
          NAME 'AstAccountSubscribeContext'
          DESC 'Asterisk subscribe context'
          EQUALITY caseIgnoreMatch
          SUBSTR caseIgnoreSubstringsMatch
          SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
  
  attributetype ( AstAccountIpAddr
          NAME 'AstAccountIpAddr'
          DESC 'Asterisk aaccount IP address'
          EQUALITY caseIgnoreMatch
          SUBSTR caseIgnoreSubstringsMatch
          SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
  
  attributetype ( AstAccountUserAgent
          NAME 'AstAccountUserAgent'
          DESC 'Asterisk account user context'
          EQUALITY caseIgnoreMatch
          SUBSTR caseIgnoreSubstringsMatch
          SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
  
  and patch fix_empty_attributes_1.6.1.4_v2.patch 
  
  (closes issue #13725)
  Reported by: macogeek
  Patches:
        fix_empty_attributes_1.6.1.4_v2.patch uploaded by xvisor (license 863)
  Tested by: suretec
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/contrib/scripts/asterisk.ldap-schema
    branches/1.6.0/contrib/scripts/asterisk.ldif
    branches/1.6.0/res/res_config_ldap.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/contrib/scripts/asterisk.ldap-schema
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.0/contrib/scripts/asterisk.ldap-schema?view=diff&rev=211768&r1=211767&r2=211768
==============================================================================
--- branches/1.6.0/contrib/scripts/asterisk.ldap-schema (original)
+++ branches/1.6.0/contrib/scripts/asterisk.ldap-schema Wed Aug 12 11:16:07 2009
@@ -1,9 +1,10 @@
 #
 # Copyright (c) 2007-2009 Suretec Systems Ltd. - <http://www.suretecsystems.com/>
 #
-# Version: 3.1.8
+# Version: 3.1.9
 #
 # Changes:
+# - https://issues.asterisk.org/view.php?id=13725 - 12/08/2009
 # - Added AsteriskVoiceMail Object class and AstAccountCallLimit attribute - 28/05/2009
 #   https://issues.asterisk.org/view.php?id=15155
 # - Added AstAccountLastQualifyMilliseconds - 28/05/2009
@@ -92,6 +93,9 @@
 objectIdentifier AstVoicemailOptions AstAttrType:56
 objectIdentifier AstVoicemailTimestamp AstAttrType:57
 objectIdentifier AstVoicemailContext AstAttrType:58
+objectIdentifier AstAccountSubscribeContext AstAttrType:59
+objectIdentifier AstAccountIpAddr AstAttrType:60
+objectIdentifier AstAccountUserAgent AstAttrType:61
 
 
 #############################################################################
@@ -543,6 +547,27 @@
 attributetype ( AstVoicemailContext
         NAME 'AstVoicemailContext'
         DESC 'Asterisk voicemail context'
+        EQUALITY caseIgnoreMatch
+        SUBSTR caseIgnoreSubstringsMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
+
+attributetype ( AstAccountSubscribeContext
+        NAME 'AstAccountSubscribeContext'
+        DESC 'Asterisk subscribe context'
+        EQUALITY caseIgnoreMatch
+        SUBSTR caseIgnoreSubstringsMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
+
+attributetype ( AstAccountIpAddr
+        NAME 'AstAccountIpAddr'
+        DESC 'Asterisk aaccount IP address'
+        EQUALITY caseIgnoreMatch
+        SUBSTR caseIgnoreSubstringsMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
+
+attributetype ( AstAccountUserAgent
+        NAME 'AstAccountUserAgent'
+        DESC 'Asterisk account user context'
         EQUALITY caseIgnoreMatch
         SUBSTR caseIgnoreSubstringsMatch
         SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
@@ -610,7 +635,10 @@
         AstAccountNoTransfer $ 
         AstAccountName $
         AstAccountLastQualifyMilliseconds $
-        AstAccountCallLimit
+        AstAccountCallLimit $
+		AstAccountSubscribeContext $
+		AstAccountIpAddr $
+		AstAccountUserAgent		
     )
     )
        
@@ -656,7 +684,10 @@
         AstAccountSecret $ 
         AstAccountName $
         AstAccountLastQualifyMilliseconds $
-        AstAccountCallLimit
+        AstAccountCallLimit $
+		AstAccountSubscribeContext $
+		AstAccountIpAddr $
+		AstAccountUserAgent	
     )
     )
 

Modified: branches/1.6.0/contrib/scripts/asterisk.ldif
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.0/contrib/scripts/asterisk.ldif?view=diff&rev=211768&r1=211767&r2=211768
==============================================================================
--- branches/1.6.0/contrib/scripts/asterisk.ldif (original)
+++ branches/1.6.0/contrib/scripts/asterisk.ldif Wed Aug 12 11:16:07 2009
@@ -1,9 +1,10 @@
 #
 # Copyright (c) 2007-2009 Suretec Systems Ltd. - <http://www.suretecsystems.com/>
 #
-# Version: 3.1.8
+# Version: 3.1.9
 #
 # Changes:
+# - https://issues.asterisk.org/view.php?id=13725 - 12/08/2009
 # - Added AsteriskVoiceMail Object class and AstAccountCallLimit attribute - 28/05/2009
 #   https://issues.asterisk.org/view.php?id=15155
 # - Added AstAccountLastQualifyMilliseconds - 28/05/2009
@@ -96,6 +97,9 @@
 olcObjectIdentifier: AstVoicemailOptions AstAttrType:56
 olcObjectIdentifier: AstVoicemailTimestamp AstAttrType:57
 olcObjectIdentifier: AstVoicemailContext AstAttrType:58
+olcObjectIdentifier: AstAccountSubscribeContext AstAttrType:59
+olcObjectIdentifier: AstAccountIpAddr AstAttrType:60
+olcObjectIdentifier: AstAccountUserAgent AstAttrType:61
 #
 #
 #############################################################################
@@ -547,6 +551,27 @@
 olcAttributeTypes: ( AstVoicemailContext
         NAME 'AstVoicemailContext'
         DESC 'Asterisk voicemail context'
+        EQUALITY caseIgnoreMatch
+        SUBSTR caseIgnoreSubstringsMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
+#
+olcAttributeTypes: ( AstAccountSubscribeContext
+        NAME 'AstAccountSubscribeContext'
+        DESC 'Asterisk subscribe context'
+        EQUALITY caseIgnoreMatch
+        SUBSTR caseIgnoreSubstringsMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
+#
+olcAttributeTypes: ( AstAccountIpAddr
+        NAME 'AstAccountIpAddr'
+        DESC 'Asterisk aaccount IP address'
+        EQUALITY caseIgnoreMatch
+        SUBSTR caseIgnoreSubstringsMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
+#
+olcAttributeTypes: ( AstAccountUserAgent
+        NAME 'AstAccountUserAgent'
+        DESC 'Asterisk account user context'
         EQUALITY caseIgnoreMatch
         SUBSTR caseIgnoreSubstringsMatch
         SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)

Modified: branches/1.6.0/res/res_config_ldap.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.0/res/res_config_ldap.c?view=diff&rev=211768&r1=211767&r2=211768
==============================================================================
--- branches/1.6.0/res/res_config_ldap.c (original)
+++ branches/1.6.0/res/res_config_ldap.c Wed Aug 12 11:16:07 2009
@@ -1224,16 +1224,21 @@
 			mods_size++;
 			ldap_mods = ast_realloc(ldap_mods, sizeof(LDAPMod *) * mods_size);
 			ldap_mods[mods_size - 1] = NULL;
+			
 			ldap_mods[mods_size - 2] = ast_calloc(1, sizeof(LDAPMod));
-
-			ldap_mods[mods_size - 2]->mod_op = LDAP_MOD_REPLACE;
 
 			ldap_mods[mods_size - 2]->mod_type = ast_calloc(sizeof(char), strlen(newparam) + 1);
 			strcpy(ldap_mods[mods_size - 2]->mod_type, newparam);
 
-			ldap_mods[mods_size - 2]->mod_values = ast_calloc(sizeof(char *), 2);
-			ldap_mods[mods_size - 2]->mod_values[0] = ast_calloc(sizeof(char), strlen(newval) + 1);
-			strcpy(ldap_mods[mods_size - 2]->mod_values[0], newval);
+			if (strlen(newval) == 0) {
+				ldap_mods[mods_size - 2]->mod_op = LDAP_MOD_DELETE;
+			} else {
+				ldap_mods[mods_size - 2]->mod_op = LDAP_MOD_REPLACE;
+
+				ldap_mods[mods_size - 2]->mod_values = ast_calloc(sizeof(char *), 2);
+				ldap_mods[mods_size - 2]->mod_values[0] = ast_calloc(sizeof(char), strlen(newval) + 1);
+				strcpy(ldap_mods[mods_size - 2]->mod_values[0], newval);
+			}
 		}
 	}
 	/* freeing ldap_mods further down */
@@ -1275,9 +1280,13 @@
 	/* Ready to update */
 	if ((num_entries = ldap_count_entries(ldapConn, ldap_result)) > 0) {
 		ast_debug(3, "LINE(%d) Modifying %s=%s hits: %d\n", __LINE__, attribute, lookup, num_entries);
-		for (i = 0; option_debug > 2 && i < mods_size - 1; i++)
-			ast_debug(3, "LINE(%d) %s=%s \n", __LINE__, ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
-
+		for (i = 0; option_debug > 2 && i < mods_size - 1; i++) {
+			if (ldap_mods[i]->mod_op != LDAP_MOD_DELETE) {
+				ast_debug(3, "LINE(%d) %s=%s \n", __LINE__, ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
+			} else {
+				ast_debug(3, "LINE(%d) deleting %s \n", __LINE__, ldap_mods[i]->mod_type);
+			}
+		}
 		ldap_entry = ldap_first_entry(ldapConn, ldap_result);
 
 		for (i = 0; ldap_entry; i++) { 




More information about the asterisk-commits mailing list