mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	app_voicemail: Fix for loop declarations
Resolve for loop initial declarations added in cli changes.
Resolves: #275
(cherry picked from commit 62480fd91b)
			
			
This commit is contained in:
		
				
					committed by
					
						 Asterisk Development Team
						Asterisk Development Team
					
				
			
			
				
	
			
			
			
						parent
						
							a8fead5885
						
					
				
				
					commit
					3e2cb7ecb1
				
			| @@ -11581,6 +11581,7 @@ static int show_mailbox_snapshot(struct ast_cli_args *a) | ||||
| 	const char *context = a->argv[4]; | ||||
| 	struct ast_vm_mailbox_snapshot *mailbox_snapshot; | ||||
| 	struct ast_vm_msg_snapshot *msg; | ||||
| 	int i; | ||||
|  | ||||
| 	/* Take a snapshot of the mailbox and walk through each folder's contents */ | ||||
| 	mailbox_snapshot = ast_vm_mailbox_snapshot_create(mailbox, context, NULL, 0, AST_VM_SNAPSHOT_SORT_BY_ID, 0); | ||||
| @@ -11591,7 +11592,7 @@ static int show_mailbox_snapshot(struct ast_cli_args *a) | ||||
|  | ||||
| 	ast_cli(a->fd, VM_STRING_HEADER_FORMAT, "Folder", "Caller ID", "Date", "Duration", "Flag", "ID"); | ||||
|  | ||||
| 	for (int i = 0; i < mailbox_snapshot->folders; i++) { | ||||
| 	for (i = 0; i < mailbox_snapshot->folders; i++) { | ||||
| 		AST_LIST_TRAVERSE(&((mailbox_snapshot)->snapshots[i]), msg, msg) { | ||||
| 			ast_cli(a->fd, VM_STRING_HEADER_FORMAT, msg->folder_name, msg->callerid, msg->origdate, msg->duration, | ||||
| 					msg->flag, msg->msg_id); | ||||
| @@ -11808,9 +11809,10 @@ static char *complete_voicemail_move_message(struct ast_cli_args *a, int maxpos) | ||||
| 		} | ||||
| 		AST_LIST_UNLOCK(&users); | ||||
| 	} else if (pos == 4 || pos == 8 || (pos == 6 && maxpos == 6) ) { | ||||
| 		int i; | ||||
| 		/* Walk through the standard folders */ | ||||
| 		wordlen = strlen(word); | ||||
| 		for (int i = 0; i < ARRAY_LEN(mailbox_folders); i++) { | ||||
| 		for (i = 0; i < ARRAY_LEN(mailbox_folders); i++) { | ||||
| 			if (folder && !strncasecmp(word, mailbox_folders[i], wordlen) && ++which > state) { | ||||
| 				return ast_strdup(mailbox_folders[i]); | ||||
| 			} | ||||
| @@ -11820,7 +11822,6 @@ static char *complete_voicemail_move_message(struct ast_cli_args *a, int maxpos) | ||||
| 		/* find messages in the folder */ | ||||
| 		struct ast_vm_mailbox_snapshot *mailbox_snapshot; | ||||
| 		struct ast_vm_msg_snapshot *msg; | ||||
| 		int i = 0; | ||||
| 		mailbox = a->argv[2]; | ||||
| 		context = a->argv[3]; | ||||
| 		folder = a->argv[4]; | ||||
| @@ -11828,6 +11829,7 @@ static char *complete_voicemail_move_message(struct ast_cli_args *a, int maxpos) | ||||
|  | ||||
| 		/* Take a snapshot of the mailbox and snag the individual info */ | ||||
| 		if ((mailbox_snapshot = ast_vm_mailbox_snapshot_create(mailbox, context, folder, 0, AST_VM_SNAPSHOT_SORT_BY_ID, 0))) { | ||||
| 			int i; | ||||
| 			/* we are only requesting the one folder, but we still need to know it's index */ | ||||
| 			for (i = 0; i < ARRAY_LEN(mailbox_folders); i++) { | ||||
| 				if (!strcasecmp(mailbox_folders[i], folder)) { | ||||
| @@ -13804,6 +13806,7 @@ static int append_vmbox_info_astman( | ||||
| 	struct ast_vm_mailbox_snapshot *mailbox_snapshot; | ||||
| 	struct ast_vm_msg_snapshot *msg; | ||||
| 	int nummessages = 0; | ||||
| 	int i; | ||||
|  | ||||
| 	/* Take a snapshot of the mailbox */ | ||||
| 	mailbox_snapshot = ast_vm_mailbox_snapshot_create(vmu->mailbox, vmu->context, NULL, 0, AST_VM_SNAPSHOT_SORT_BY_ID, 0); | ||||
| @@ -13815,7 +13818,7 @@ static int append_vmbox_info_astman( | ||||
|  | ||||
| 	astman_send_listack(s, m, "Voicemail box detail will follow", "start"); | ||||
| 	/* walk through each folder's contents and append info for each message */ | ||||
| 	for (int i = 0; i < mailbox_snapshot->folders; i++) { | ||||
| 	for (i = 0; i < mailbox_snapshot->folders; i++) { | ||||
| 		AST_LIST_TRAVERSE(&((mailbox_snapshot)->snapshots[i]), msg, msg) { | ||||
| 			astman_append(s, | ||||
| 				"Event: %s\r\n" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user