Index: pjproject/trunk/pjlib-util/src/pjlib-util/cli.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/cli.c	(revision 4512)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/cli.c	(revision 4513)
@@ -35,4 +35,7 @@
 #define CLI_CMD_EXIT        30001
 
+#define MAX_CMD_HASH_NAME_LENGTH 64
+#define MAX_CMD_ID_LENGTH 16
+
 #if 1
     /* Enable some tracing */
@@ -127,5 +130,7 @@
     pj_cli_cmd_spec     root;           /* Root of command tree structure */
     pj_cli_front_end    fe_head;        /* List of front-ends */
-    pj_hash_table_t    *cmd_name_hash;  /* Command name hash table */
+    pj_hash_table_t    *cmd_name_hash;  /* Command name hash table, this will 
+					   include the command name and shortcut 
+					   as hash key */
     pj_hash_table_t    *cmd_id_hash;    /* Command id hash table */
 
@@ -485,22 +490,23 @@
 }
 
-/* Check if command already added to command hash */
-static pj_bool_t cmd_name_exists(pj_cli_t *cli, pj_cli_cmd_spec *group, 
-				 pj_str_t *cmd)
+/* Get the command from the command hash */
+static pj_cli_cmd_spec *get_cmd_name(const pj_cli_t *cli, 
+				     const pj_cli_cmd_spec *group, 
+				     const pj_str_t *cmd)
 {
     pj_str_t cmd_val;
-    char cmd_ptr[64];
-
-    cmd_val.ptr = &cmd_ptr[0];
+    char cmd_ptr[MAX_CMD_HASH_NAME_LENGTH];
+
+    cmd_val.ptr = cmd_ptr;
     cmd_val.slen = 0;
 
     if (group) {
-	char cmd_str[16];
-	pj_ansi_sprintf(&cmd_str[0], "%d", group->id);
-	pj_strcat2(&cmd_val, &cmd_str[0]);	
+	char cmd_str[MAX_CMD_ID_LENGTH];
+	pj_ansi_sprintf(cmd_str, "%d", group->id);
+	pj_strcat2(&cmd_val, cmd_str);	
     }
     pj_strcat(&cmd_val, cmd);
-    return (pj_hash_get(cli->cmd_name_hash, 
-	                cmd_val.ptr, cmd_val.slen, NULL) != 0);
+    return (pj_cli_cmd_spec *)pj_hash_get(cli->cmd_name_hash, cmd_val.ptr, 
+					  cmd_val.slen, NULL);
 }
 
@@ -511,17 +517,19 @@
     pj_str_t cmd_val;
     pj_str_t add_cmd;
-    char cmd_ptr[64];
-
-    cmd_val.ptr = &cmd_ptr[0];
+    char cmd_ptr[MAX_CMD_HASH_NAME_LENGTH];
+
+    cmd_val.ptr = cmd_ptr;
     cmd_val.slen = 0;
 
     if (group) {
-	pj_strcat(&cmd_val, &group->name);
+	char cmd_str[MAX_CMD_ID_LENGTH];
+	pj_ansi_sprintf(cmd_str, "%d", group->id);
+	pj_strcat2(&cmd_val, cmd_str);	
     }
     pj_strcat(&cmd_val, cmd_name);
     pj_strdup(cli->pool, &add_cmd, &cmd_val);
     
-    pj_hash_set(cli->pool, cli->cmd_name_hash, 
-		cmd_val.ptr, cmd_val.slen, 0, cmd);
+    pj_hash_set(cli->pool, cli->cmd_name_hash, cmd_val.ptr, 
+		cmd_val.slen, 0, cmd);
 }
 
@@ -665,5 +673,5 @@
             pj_strltrim(&attr->value);
             if (!attr->value.slen || 
-		cmd_name_exists(cli, group, &attr->value))                
+		(get_cmd_name(cli, group, &attr->value)))                
             {
                 return PJ_CLI_EBADNAME;
@@ -703,5 +711,5 @@
                     }
                     /* Check whether the shortcuts are already used */
-                    if (cmd_name_exists(cli, group, &str)) {
+                    if (get_cmd_name(cli, &cli->root, &str)) {
                         PJ_THROW(PJ_CLI_EBADNAME);
                     }
@@ -773,6 +781,7 @@
                                              sizeof(pj_str_t));
         for (i = 0; i < cmd->sc_cnt; i++) {
-            pj_strdup(cli->pool, &cmd->sc[i], &sc[i]);
-	    add_cmd_name(cli, group, cmd, &sc[i]);
+            pj_strdup(cli->pool, &cmd->sc[i], &sc[i]);	
+	    /** Add shortcut to root command **/
+	    add_cmd_name(cli, &cli->root, cmd, &sc[i]);
         }
     }
@@ -881,7 +890,7 @@
 		info->err_pos = scanner.curptr - scanner.begin;
 		if (*scanner.curptr == '\'' || *scanner.curptr == '"' ||
-		    *scanner.curptr == '[' || *scanner.curptr == '{')
+		    *scanner.curptr == '{')
 		{
-		    pj_scan_get_quotes(&scanner, "'\"[{", "'\"]}", 4, &str);
+		    pj_scan_get_quotes(&scanner, "'\"{", "'\"}", 3, &str);
 		    /* Remove the quotes */
 		    str.ptr++;
@@ -983,4 +992,59 @@
 }
 
+static pj_bool_t hint_inserted(const pj_str_t *name, 
+			       const pj_str_t *desc, 
+			       const pj_str_t *type, 
+			       pj_cli_exec_info *info)
+{
+    unsigned i;
+    for(i=0; i<info->hint_cnt; ++i) {
+	pj_cli_hint_info *hint = &info->hint[i];
+	if ((!pj_strncmp(&hint->name, name, hint->name.slen)) &&
+	    (!pj_strncmp(&hint->desc, desc, hint->desc.slen)) &&
+	    (!pj_strncmp(&hint->type, type, hint->type.slen)))
+	{
+	    return PJ_TRUE;
+	}
+    }
+    return PJ_FALSE;
+}
+
+/** This will insert new hint with the option to check for the same 
+    previous entry **/
+static pj_status_t insert_new_hint2(pj_pool_t *pool, 
+				    pj_bool_t unique_insert,
+				    const pj_str_t *name, 
+				    const pj_str_t *desc, 
+				    const pj_str_t *type, 
+				    pj_cli_exec_info *info)
+{
+    pj_cli_hint_info *hint;
+    PJ_ASSERT_RETURN(pool && info, PJ_EINVAL);
+    PJ_ASSERT_RETURN((info->hint_cnt < PJ_CLI_MAX_HINTS), PJ_EINVAL);
+
+    if ((unique_insert) && (hint_inserted(name, desc, type, info)))
+	return PJ_SUCCESS;
+
+    hint = &info->hint[info->hint_cnt];
+
+    pj_strdup(pool, &hint->name, name);
+
+    if (desc && (desc->slen > 0))  {
+	pj_strdup(pool, &hint->desc, desc);
+    } else {
+	hint->desc.slen = 0;
+    }
+    
+    if (type && (type->slen > 0)) {
+	pj_strdup(pool, &hint->type, type);
+    } else {
+	hint->type.slen = 0;
+    }
+
+    ++info->hint_cnt;    
+    return PJ_SUCCESS;
+}
+
+/** This will insert new hint without checking for the same previous entry **/
 static pj_status_t insert_new_hint(pj_pool_t *pool, 
 				   const pj_str_t *name, 
@@ -989,35 +1053,89 @@
 				   pj_cli_exec_info *info)
 {        
-    pj_cli_hint_info *hint;
-    PJ_ASSERT_RETURN(pool && info, PJ_EINVAL);
-    PJ_ASSERT_RETURN((info->hint_cnt < PJ_CLI_MAX_HINTS), PJ_EINVAL);
-    hint = &info->hint[info->hint_cnt];
-
-    pj_strdup(pool, &hint->name, name);
-
-    if (desc && (desc->slen > 0))  {
-	pj_strdup(pool, &hint->desc, desc);
-    } else {
-	hint->desc.slen = 0;
-    }
-    
-    if (type && (type->slen > 0)) {
-	pj_strdup(pool, &hint->type, type);
-    } else {
-	hint->type.slen = 0;
-    }
-
-    ++info->hint_cnt;    
+    return insert_new_hint2(pool, PJ_FALSE, name, desc, type, info);
+}
+
+/** This will get a complete/exact match of a command from the cmd hash **/
+static pj_status_t get_comp_match_cmds(const pj_cli_t *cli, 
+				       const pj_cli_cmd_spec *group,
+				       const pj_str_t *cmd_val,	
+				       pj_pool_t *pool, 
+				       pj_cli_cmd_spec **p_cmd,
+				       pj_cli_exec_info *info)
+{
+    pj_cli_cmd_spec *cmd;    
+    PJ_ASSERT_RETURN(cli && group && cmd_val && pool && info, PJ_EINVAL);   
+
+    cmd = get_cmd_name(cli, group, cmd_val);
+
+    if (cmd) {
+	pj_status_t status;    
+	status = insert_new_hint(pool, cmd_val, &cmd->desc, NULL, info);
+
+	if (status != PJ_SUCCESS)
+	    return status;
+
+	*p_cmd = cmd;
+    }
+
     return PJ_SUCCESS;
 }
 
-static pj_status_t get_match_cmds(pj_cli_cmd_spec *cmd, 
-				  const pj_str_t *cmd_val,				      
-				  pj_pool_t *pool, 
-				  pj_cli_cmd_spec **p_cmd, 			       
-				  pj_cli_exec_info *info)
-{
-    pj_status_t status = PJ_SUCCESS;
-    PJ_ASSERT_RETURN(cmd && pool && info && cmd_val, PJ_EINVAL);    
+/** This method will search for any shortcut with pattern match to the input
+    command. This method should be called from root command, as shortcut could
+    only be executed from root **/
+static pj_status_t get_pattern_match_shortcut(const pj_cli_t *cli,
+					      const pj_str_t *cmd_val,
+					      pj_pool_t *pool, 
+					      pj_cli_cmd_spec **p_cmd,
+					      pj_cli_exec_info *info)
+{
+    pj_hash_iterator_t it_buf, *it;
+    pj_status_t status;
+    PJ_ASSERT_RETURN(cli && pool && cmd_val && info, PJ_EINVAL);
+  
+    it = pj_hash_first(cli->cmd_name_hash, &it_buf);
+    while (it) {
+	unsigned i;
+	pj_cli_cmd_spec *cmd = (pj_cli_cmd_spec *)
+			       pj_hash_this(cli->cmd_name_hash, it);
+
+	PJ_ASSERT_RETURN(cmd, PJ_EINVAL);	    
+	
+	for (i=0; i < cmd->sc_cnt; ++i) {
+	    static const pj_str_t SHORTCUT = {"SC", 2};
+	    pj_str_t *sc = &cmd->sc[i];
+	    PJ_ASSERT_RETURN(sc, PJ_EINVAL);
+
+	    if (!pj_strncmp(sc, cmd_val, cmd_val->slen)) {
+		/** Unique hints needed because cmd hash contain command name
+		    and shortcut referencing to the same command **/
+		status = insert_new_hint2(pool, PJ_TRUE, sc, &cmd->desc, 
+					  &SHORTCUT, info);
+		if (status != PJ_SUCCESS)
+		    return status;
+
+		if (p_cmd)
+		    *p_cmd = cmd;
+	    }
+	}
+	
+	it = pj_hash_next(cli->cmd_name_hash, it);
+    }
+
+    return PJ_SUCCESS;
+}
+
+/** This method will search a pattern match to the input command from the child
+    command list of the current/active command. **/
+static pj_status_t get_pattern_match_cmds(pj_cli_cmd_spec *cmd, 
+					  const pj_str_t *cmd_val,				      
+					  pj_pool_t *pool, 
+					  pj_cli_cmd_spec **p_cmd, 
+					  pj_cli_parse_mode parse_mode,
+					  pj_cli_exec_info *info)
+{
+    pj_status_t status;
+    PJ_ASSERT_RETURN(cmd && pool && info && cmd_val, PJ_EINVAL);   
 
     if (p_cmd)
@@ -1028,5 +1146,4 @@
 	pj_cli_cmd_spec *child_cmd = cmd->sub_cmd->next;
 	while (child_cmd != cmd->sub_cmd) {
-	    unsigned i;	   
 	    pj_bool_t found = PJ_FALSE;
 	    if (!pj_strncmp(&child_cmd->name, cmd_val, cmd_val->slen)) {		
@@ -1038,27 +1155,32 @@
 		found = PJ_TRUE;
 	    }
-	    for (i=0; i < child_cmd->sc_cnt; ++i) {
-		static const pj_str_t SHORTCUT = {"SC", 2};
-		pj_str_t *sc = &child_cmd->sc[i];
-		PJ_ASSERT_RETURN(sc, PJ_EINVAL);
-
-		if (!pj_strncmp(sc, cmd_val, cmd_val->slen)) {		
-		    status = insert_new_hint(pool, sc, &child_cmd->desc, 
-					     &SHORTCUT, info);
-		    if (status != PJ_SUCCESS)
-			return status;
-
-		    found = PJ_TRUE;
-		}		
-	    }
-	    if (found && p_cmd) 
-		*p_cmd = child_cmd;			    
-
+	    if (found) {
+		if (parse_mode == PARSE_NEXT_AVAIL) {
+		    /** Only insert shortcut on next available commands mode **/
+		    unsigned i;
+		    for (i=0; i < child_cmd->sc_cnt; ++i) {
+			static const pj_str_t SHORTCUT = {"SC", 2};
+			pj_str_t *sc = &child_cmd->sc[i];
+			PJ_ASSERT_RETURN(sc, PJ_EINVAL);
+
+			status = insert_new_hint(pool, sc, 
+						 &child_cmd->desc, &SHORTCUT, 
+						 info);
+			if (status != PJ_SUCCESS)
+			    return status;
+		    }
+		}
+
+		if (p_cmd)
+		    *p_cmd = child_cmd;			    
+	    }	
 	    child_cmd = child_cmd->next;
 	}
     }
-    return status;
-}
-
+    return PJ_SUCCESS;
+}
+
+/** This will match the arguments passed to the command with the argument list
+    of the specified command list. **/
 static pj_status_t get_match_args(pj_cli_sess *sess,
 				  pj_cli_cmd_spec *cmd, 
@@ -1089,9 +1211,5 @@
 	    if ((parse_mode == PARSE_EXEC) && (!arg->validate)) {
 		/* If no validation needed, then insert the values */
-		status = insert_new_hint(pool, 
-					 cmd_val, 
-			  	         NULL, 
-					 NULL,
-					 info);		
+		status = insert_new_hint(pool, cmd_val, NULL, NULL, info);		
 		return status;
 	    }
@@ -1165,4 +1283,6 @@
 }
 
+/** This will check for a match of the commands/arguments input. Any match 
+    will be inserted to the hint data. **/
 static pj_status_t get_available_cmds(pj_cli_sess *sess,
 				      pj_cli_cmd_spec *cmd, 
@@ -1183,6 +1303,31 @@
     info->hint_cnt = 0;    
 
-    if (get_cmd)
-	status = get_match_cmds(cmd, prefix, pool, p_cmd, info);
+    if (get_cmd) {
+	status = get_comp_match_cmds(sess->fe->cli, cmd, prefix, pool, p_cmd, 
+				     info);
+	if (status != PJ_SUCCESS)
+	    return status;
+	
+	/** If exact match found, then no need to search for pattern match **/
+	if (info->hint_cnt == 0) {
+	    if ((parse_mode != PARSE_NEXT_AVAIL) && 
+		(cmd == &sess->fe->cli->root)) 
+	    {
+		/** Pattern match for shortcut needed on root command only **/
+		status = get_pattern_match_shortcut(sess->fe->cli, prefix, pool,
+						    p_cmd, info);
+
+		if (status != PJ_SUCCESS)
+		    return status;
+	    }
+
+	    status = get_pattern_match_cmds(cmd, prefix, pool, p_cmd, 
+					    parse_mode, info);
+	}
+
+	if (status != PJ_SUCCESS)
+	    return status;
+    }
+
     if (argc > 0)
 	status = get_match_args(sess, cmd, prefix, argc, 
@@ -1191,4 +1336,6 @@
     if (status == PJ_SUCCESS) {	
 	if (prefix->slen > 0) {
+	    /** If a command entered is not a an empty command, and have a 
+		single match in the command list then it is a valid command **/
 	    if (info->hint_cnt == 0) {
 		status = PJ_CLI_EINVARG;
Index: pjproject/trunk/pjlib-util/src/pjlib-util/cli_console.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/cli_console.c	(revision 4512)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/cli_console.c	(revision 4513)
@@ -182,5 +182,5 @@
     struct cli_console_fe *fe = (struct cli_console_fe *)sess->fe;
 
-    send_data.ptr = &data_str[0];
+    send_data.ptr = data_str;
     send_data.slen = 0;
     
@@ -202,5 +202,5 @@
     struct cli_console_fe *fe = (struct cli_console_fe *)sess->fe;
 
-    send_data.ptr = &data_str[0];
+    send_data.ptr = data_str;
     send_data.slen = 0;
 
@@ -273,5 +273,5 @@
     static const pj_str_t sc_type = {"sc", 2};
     static const pj_str_t choice_type = {"choice", 6};
-    send_data.ptr = &data[0];
+    send_data.ptr = data;
     send_data.slen = 0;
     
@@ -288,7 +288,10 @@
     for (i=0;i<info->hint_cnt;++i) {
 	if ((&hint[i].type) && (hint[i].type.slen > 0)) {	    
-	    if (pj_stricmp(&hint[i].type, &sc_type) == 0) {
-		//Additional delimiter " | "
-		cmd_length += (hint[i].name.slen + 3);
+	    if (pj_stricmp(&hint[i].type, &sc_type) == 0) {		
+		if ((i > 0) && (!pj_stricmp(&hint[i-1].desc, &hint[i].desc))) {
+		    cmd_length += (hint[i].name.slen + 3);
+		} else {
+		    cmd_length = hint[i].name.slen;
+		}		
 	    } else {
 		cmd_length = hint[i].name.slen;
@@ -304,5 +307,5 @@
 
     cmd_length = 0;
-    for (i=0;i<info->hint_cnt;++i) {	
+    for (i=0;i<info->hint_cnt;++i) {
 	if ((&hint[i].type) && (hint[i].type.slen > 0)) {	    
 	    if (pj_stricmp(&hint[i].type, &sc_type) == 0) {
@@ -317,10 +320,5 @@
 	}
 
-	if ((parse_state != OP_SHORTCUT)) {
-	    if (cmd_desc) {
-		/* Print data if previous hint is shortcut */
-		send_hint_arg(&send_data, cmd_desc, cmd_length, max_length);
-		cmd_desc = 0;
-	    }
+	if (parse_state != OP_SHORTCUT) {
 	    pj_strcat2(&send_data, "\r\n  ");
 	    cmd_length = hint[i].name.slen;
@@ -338,8 +336,16 @@
 	    pj_strcat2(&send_data, ">");	
 	    break;
-	case OP_SHORTCUT:	    
-	    pj_strcat2(&send_data, " | ");
-	    pj_strcat(&send_data, &hint[i].name);
-	    cmd_length += (hint[i].name.slen + 3);
+	case OP_SHORTCUT:
+	    /* Format : "Command | sc |  description" */
+	    {		
+		cmd_length += hint[i].name.slen;
+		if ((i > 0) && (!pj_stricmp(&hint[i-1].desc, &hint[i].desc))) {
+		    pj_strcat2(&send_data, " | ");
+		    cmd_length += 3;		    
+		} else {
+		    pj_strcat2(&send_data, "\r\n  ");
+		}
+		pj_strcat(&send_data, &hint[i].name);	
+	    }
 	    break;
 	default:
@@ -350,8 +356,11 @@
     	
 	if ((parse_state == OP_TYPE) || (parse_state == OP_CHOICE) || 
-	    ((i+1) >= info->hint_cnt)) 
+	    ((i+1) >= info->hint_cnt) ||
+	    (pj_strncmp(&hint[i].desc, &hint[i+1].desc, hint[i].desc.slen))) 
 	{
 	    /* Add description info */
 	    send_hint_arg(&send_data, &hint[i].desc, cmd_length, max_length);
+
+	    cmd_length = 0;
 	}
     }  
Index: pjproject/trunk/pjlib-util/src/pjlib-util/cli_telnet.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/cli_telnet.c	(revision 4512)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/cli_telnet.c	(revision 4513)
@@ -668,5 +668,5 @@
     cli_telnet_fe *fe = (cli_telnet_fe *)sess->base.fe;
 
-    send_data.ptr = &data_str[0];
+    send_data.ptr = data_str;
     send_data.slen = 0;
     
@@ -692,5 +692,5 @@
     cli_telnet_fe *fe = (cli_telnet_fe *)sess->base.fe;
 
-    send_data.ptr = &data_str[0];
+    send_data.ptr = data_str;
     send_data.slen = 0;
 
@@ -709,5 +709,5 @@
     pj_strcat(&send_data, &fe->cfg.prompt_str);
     if (with_last_cmd)
-	pj_strcat2(&send_data, (char *)&sess->rcmd->rbuf[0]);
+	pj_strcat2(&send_data, (char *)sess->rcmd->rbuf);
 
     telnet_sess_send(sess, &send_data);
@@ -772,5 +772,5 @@
     static const pj_str_t sc_type = {"sc", 2};
     static const pj_str_t choice_type = {"choice", 6};
-    send_data.ptr = &data[0];
+    send_data.ptr = data;
     send_data.slen = 0;
     
@@ -787,7 +787,10 @@
     for (i=0;i<info->hint_cnt;++i) {
 	if ((&hint[i].type) && (hint[i].type.slen > 0)) {	    
-	    if (pj_stricmp(&hint[i].type, &sc_type) == 0) {
-		//Additional delimiter " | "
-		cmd_length += (hint[i].name.slen + 3);
+	    if (pj_stricmp(&hint[i].type, &sc_type) == 0) {		
+		if ((i > 0) && (!pj_stricmp(&hint[i-1].desc, &hint[i].desc))) {
+		    cmd_length += (hint[i].name.slen + 3);
+		} else {
+		    cmd_length = hint[i].name.slen;
+		}		
 	    } else {
 		cmd_length = hint[i].name.slen;
@@ -817,16 +820,9 @@
 	}
 	
-	if ((parse_state != OP_SHORTCUT)) {
-	    if (cmd_desc) {
-		/* Print data if previous hint is shortcut */
-		send_hint_arg(sess, &send_data, 
-			      cmd_desc, cmd_length, 
-			      max_length);
-		cmd_desc = 0;
-	    }
+	if (parse_state != OP_SHORTCUT) {
 	    pj_strcat2(&send_data, "\r\n  ");
 	    cmd_length = hint[i].name.slen;
-	}
-
+	}	    
+	
 	switch (parse_state) {
 	case OP_CHOICE:
@@ -844,7 +840,14 @@
 	case OP_SHORTCUT:
 	    /* Format : "Command | sc |  description" */
-	    pj_strcat2(&send_data, " | ");
-	    pj_strcat(&send_data, &hint[i].name);
-	    cmd_length += (hint[i].name.slen + 3);
+	    {		
+		cmd_length += hint[i].name.slen;
+		if ((i > 0) && (!pj_stricmp(&hint[i-1].desc, &hint[i].desc))) {
+		    pj_strcat2(&send_data, " | ");
+		    cmd_length += 3;		    
+		} else {
+		    pj_strcat2(&send_data, "\r\n  ");
+		}
+		pj_strcat(&send_data, &hint[i].name);	
+	    }
 	    break;
 	default:
@@ -856,5 +859,6 @@
     	
 	if ((parse_state == OP_TYPE) || (parse_state == OP_CHOICE) || 
-	    ((i+1) >= info->hint_cnt)) 
+	    ((i+1) >= info->hint_cnt) ||
+	    (pj_strncmp(&hint[i].desc, &hint[i+1].desc, hint[i].desc.slen))) 
 	{
 	    /* Add description info */
@@ -862,4 +866,6 @@
 			  &hint[i].desc, cmd_length, 
 			  max_length);
+
+	    cmd_length = 0;
 	}	
     }  
@@ -867,5 +873,5 @@
     pj_strcat(&send_data, &fe->cfg.prompt_str);
     if (with_last_cmd)
-	pj_strcat2(&send_data, (char *)&sess->rcmd->rbuf[0]);
+	pj_strcat2(&send_data, (char *)sess->rcmd->rbuf);
 
     telnet_sess_send(sess, &send_data);    
@@ -883,5 +889,5 @@
     pj_strcat2(&info->hint[0].name, " ");
 
-    send_data.ptr = &data[0];
+    send_data.ptr = data;
     send_data.slen = 0;
 
@@ -901,5 +907,5 @@
 	    unsigned char echo[5] = {0x1b, 0x5b, 0x31, 0x40, 0x00};
 	    echo[4] = *data;
-	    telnet_sess_send2(sess, &echo[0], 5);
+	    telnet_sess_send2(sess, echo, 5);
 	} else {
 	    /* Append character */
@@ -925,8 +931,8 @@
 	    unsigned char echo[5] = {0x00, 0x1b, 0x5b, 0x31, 0x50};
 	    echo[0] = *data;
-	    telnet_sess_send2(sess, &echo[0], 5);
+	    telnet_sess_send2(sess, echo, 5);
 	} else {
 	    const static unsigned char echo[3] = {0x08, 0x20, 0x08};	    
-	    telnet_sess_send2(sess, &echo[0], 3);
+	    telnet_sess_send2(sess, echo, 3);
 	}
 	return PJ_TRUE;
@@ -987,5 +993,5 @@
 			       pool, &info);    
 
-    len = pj_ansi_strlen((char *)&sess->rcmd->rbuf[0]);
+    len = pj_ansi_strlen((char *)sess->rcmd->rbuf);
 
     switch (status) {
@@ -1010,5 +1016,5 @@
 	if (info.hint_cnt > 0) {	
 	    /* Complete command */
-	    pj_str_t cmd = pj_str((char *)&sess->rcmd->rbuf[0]);
+	    pj_str_t cmd = pj_str((char *)sess->rcmd->rbuf);
 	    pj_str_t last_token;
 
@@ -1019,5 +1025,5 @@
 		if (hint_info->slen >= last_token.slen) {
 		    hint_info->slen -= last_token.slen;
-		    pj_memmove(&hint_info->ptr[0], 
+		    pj_memmove(hint_info->ptr, 
 			       &hint_info->ptr[last_token.slen], 
 			       hint_info->slen);		    
@@ -1025,5 +1031,5 @@
 		send_comp_arg(sess, &info);
 
-		pj_memcpy(&sess->rcmd->rbuf[len], &info.hint[0].name.ptr[0], 
+		pj_memcpy(&sess->rcmd->rbuf[len], info.hint[0].name.ptr, 
 			  info.hint[0].name.slen);
 
@@ -1136,5 +1142,5 @@
 	    CLEAR_CHAR = 0x20
 	};
-	send_data.ptr = &str[0];
+	send_data.ptr = str;
 	send_data.slen = 0;
 
Index: pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_cli.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_cli.c	(revision 4512)
+++ pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_cli.c	(revision 4513)
@@ -246,5 +246,5 @@
 	/* Main loop for CLI FE console */
 	while (!pj_cli_is_quitting(cli)) {
-	    pj_cli_console_process(cli_cons_sess, &cmdline[0], sizeof(cmdline));
+	    pj_cli_console_process(cli_cons_sess, cmdline, sizeof(cmdline));
 	}
     } else if (wait_telnet_cli) {
@@ -2632,5 +2632,5 @@
     char* call_command = 
 	"<CMD name='call' id='100' desc='Call related commands'>"
-	"  <CMD name='new' id='1001' desc='Show Help'>"
+	"  <CMD name='new' id='1001' desc='Make a new call/INVITE'>"
 	"    <ARG name='buddy_id' type='choice' id='9901' validate='0' "
 	"     desc='Buddy Id'>"
@@ -2658,6 +2658,6 @@
 	"   desc='Re-invite (release hold)'/>"
 	"  <CMD name='update' id='1008' sc='U' desc='Send Update request'/>"
-	"  <CMD name='next' id='1009' sc='>' desc='Select next call'/>"
-	"  <CMD name='previous' id='1010' sc='<' desc='Select previous call'/>"
+	"  <CMD name='next' id='1009' sc=']' desc='Select next call'/>"
+	"  <CMD name='previous' id='1010' sc='[' desc='Select previous call'/>"
 	"  <CMD name='transfer' id='1011' sc='x' desc='Transfer call'>"
 	"    <ARG name='buddy_id' type='choice' id='9901' validate='0' "
@@ -2751,5 +2751,5 @@
 	"    </ARG>"
 	"  </CMD>"
-	"  <CMD name='bud_list' id='2008' sc='l' desc='Show buddy list'/>"
+	"  <CMD name='bud_list' id='2008' sc='bl' desc='Show buddy list'/>"
 	"</CMD>";
 
Index: pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_config.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_config.c	(revision 4512)
+++ pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_config.c	(revision 4513)
@@ -524,5 +524,5 @@
 
     cfg->acc_cnt = 0;
-    cur_acc = &cfg->acc_cfg[0];
+    cur_acc = cfg->acc_cfg;
 
 
