[asterisk-commits] tilghman: trunk r279602 - in /trunk: ./ res/res_config_ldap.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 26 16:08:29 CDT 2010


Author: tilghman
Date: Mon Jul 26 16:08:24 2010
New Revision: 279602

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=279602
Log:
Merged revisions 279601 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r279601 | tilghman | 2010-07-26 16:07:45 -0500 (Mon, 26 Jul 2010) | 19 lines
  
  Merged revisions 279597 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r279597 | ghenry | 2010-07-26 15:25:54 -0500 (Mon, 26 Jul 2010) | 13 lines
    
    Apply all patches in:
    
    https://issues.asterisk.org/view.php?id=13573
    
    (closes issue #13573)
    Reported by: navkumar
    Patches: 
          res_config_ldap-category.diff uploaded by navkumar (license 580)
          res_config_ldap.patch uploaded by bencer (license 961)
          res_config_ldap uploaded by bencer (license 961)
    Tested by: suretec
  ........
................

Modified:
    trunk/   (props changed)
    trunk/res/res_config_ldap.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.8-merged (original)
+++ branch-1.8-merged Mon Jul 26 16:08:24 2010
@@ -1,1 +1,1 @@
-/branches/1.8:1-279056,279113,279227,279273,279280,279314,279390,279410,279442,279472,279502,279504,279562,279566,279568,279598
+/branches/1.8:1-279056,279113,279227,279273,279280,279314,279390,279410,279442,279472,279502,279504,279562,279566,279568,279598,279601

Modified: trunk/res/res_config_ldap.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_config_ldap.c?view=diff&rev=279602&r1=279601&r2=279602
==============================================================================
--- trunk/res/res_config_ldap.c (original)
+++ trunk/res/res_config_ldap.c Mon Jul 26 16:08:24 2010
@@ -65,7 +65,7 @@
 static LDAP *ldapConn;
 static char url[512];
 static char user[512];
-static char pass[50];
+static char pass[512];
 static char base_distinguished_name[512];
 static int version;
 static time_t connect_time;
@@ -84,8 +84,8 @@
 
 /*! \brief Table configuration */
 struct ldap_table_config {
-	char *table_name;                 /*!< table name */
-	char *additional_filter;          /*!< additional filter        */
+	char *table_name;		 /*!< table name */
+	char *additional_filter;	  /*!< additional filter	*/
 	struct ast_variable *attributes;  /*!< attribute names conversion */
 	struct ast_variable *delimiters;  /*!< the current delimiter is semicolon, so we are not using this variable */
 	AST_LIST_ENTRY(ldap_table_config) entry;
@@ -955,8 +955,23 @@
 static struct ast_config *realtime_multi_ldap(const char *basedn,
       const char *table_name, va_list ap)
 {
-	struct ast_variable **vars = realtime_ldap_base_ap(NULL, basedn, table_name, ap);
+	char *op;
+	const char *initfield = NULL;
+	const char *newparam, *newval;
+	struct ast_variable **vars =
+		realtime_ldap_base_ap(NULL, basedn, table_name, ap);
 	struct ast_config *cfg = NULL;
+
+	newparam = va_arg(ap, const char *);
+	newval = va_arg(ap, const char *);
+	if (!newparam || !newval) {
+	    ast_log(LOG_WARNING, "realtime retrieval requires at least 1 parameter and 1 value to search on.\n");
+	    return NULL;
+	}
+	initfield = ast_strdupa(newparam);
+	if ((op = strchr(initfield, ' '))) {
+		*op = '\0';
+	}
 
 	if (vars) {
 		cfg = ast_config_new();
@@ -975,6 +990,9 @@
 					struct ast_variable *var = *p;
 					while (var) {
 						struct ast_variable *next = var->next;
+						if (initfield && !strcmp(initfield, var->name)) {
+							ast_category_rename(cat, var->value);
+						}
 						var->next = NULL;
 						ast_variable_append(cat, var);
 						var = next;
@@ -1746,7 +1764,7 @@
 		e->command = "realtime show ldap status";
 		e->usage =
 			"Usage: realtime show ldap status\n"
-			"               Shows connection information for the LDAP RealTime driver\n";
+			"	       Shows connection information for the LDAP RealTime driver\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;




More information about the asterisk-commits mailing list