mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 18:55:19 +00:00 
			
		
		
		
	If '#' is sent for username, use callerid if available (bug #2301)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -3517,6 +3517,7 @@ static int vm_execmain(struct ast_channel *chan, void *data) | |||||||
| 	struct ast_vm_user *vmu = NULL, vmus; | 	struct ast_vm_user *vmu = NULL, vmus; | ||||||
| 	char *context=NULL; | 	char *context=NULL; | ||||||
| 	int silentexit = 0; | 	int silentexit = 0; | ||||||
|  | 	char cid[256]=""; | ||||||
|  |  | ||||||
| 	LOCAL_USER_ADD(u); | 	LOCAL_USER_ADD(u); | ||||||
| 	memset(&vms, 0, sizeof(vms)); | 	memset(&vms, 0, sizeof(vms)); | ||||||
| @@ -3576,10 +3577,21 @@ static int vm_execmain(struct ast_channel *chan, void *data) | |||||||
| 			goto out; | 			goto out; | ||||||
| 		} | 		} | ||||||
| 		if (ast_strlen_zero(vms.username)) { | 		if (ast_strlen_zero(vms.username)) { | ||||||
| 			if (option_verbose > 2) | 				char *callerid=NULL, *name=NULL; | ||||||
| 				ast_verbose(VERBOSE_PREFIX_3 "Username not entered\n"); | 				if(chan->callerid != NULL) { | ||||||
| 			res = 0; | 					strncpy(cid, chan->callerid, sizeof(cid) - 1); | ||||||
| 			goto out; | 					ast_callerid_parse(cid, &name, &callerid); | ||||||
|  | 				} | ||||||
|  | 				if(callerid != NULL) {			 | ||||||
|  | 					if (option_verbose > 2) | ||||||
|  | 					ast_verbose(VERBOSE_PREFIX_3 "No username but # key pressed. Using CID '%s'\n",callerid); | ||||||
|  | 					strncpy(vms.username, callerid, sizeof(vms.username) - 1); | ||||||
|  | 				} else { | ||||||
|  | 					if (option_verbose > 2) | ||||||
|  | 					ast_verbose(VERBOSE_PREFIX_3 "Username not entered\n");	 | ||||||
|  | 					res = 0; | ||||||
|  | 					goto out; | ||||||
|  | 				} | ||||||
| 		} | 		} | ||||||
| 		if (useadsi) | 		if (useadsi) | ||||||
| 			adsi_password(chan); | 			adsi_password(chan); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user