mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	res_agi: RECORD FILE plays 2 beeps.
Sending the "RECORD FILE" command without the optional `offset_samples` argument can result in two beeps playing on the channel. This bug has been present since Asterisk 0.3.0 (2003-02-06). ASTERISK-30457 #close Change-Id: I95e88aa59378784d7f0eb648843f090e6723b787
This commit is contained in:
		
				
					committed by
					
						 Friendly Automation
						Friendly Automation
					
				
			
			
				
	
			
			
			
						parent
						
							cec0c5cd39
						
					
				
				
					commit
					76a2b2703f
				
			| @@ -2955,12 +2955,18 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, const | ||||
|  | ||||
| 	/* backward compatibility, if no offset given, arg[6] would have been | ||||
| 	 * caught below and taken to be a beep, else if it is a digit then it is a | ||||
| 	 * offset */ | ||||
| 	if ((argc >6) && (sscanf(argv[6], "%30ld", &sample_offset) != 1) && (!strchr(argv[6], '='))) | ||||
| 		res = ast_streamfile(chan, "beep", ast_channel_language(chan)); | ||||
|  | ||||
| 	if ((argc > 7) && (!strchr(argv[7], '='))) | ||||
| 	 * offset. | ||||
| 	 * | ||||
| 	 * In other words, if the argument does not look like the offset_samples | ||||
| 	 * argument (a number) and it doesn't look like the silence argument (starts | ||||
| 	 * with "s=") then it must be the beep argument. The beep argument has no | ||||
| 	 * required value, the presence of anything in the argument slot we are | ||||
| 	 * inspecting is an indication that the user wants a beep played. | ||||
| 	 */ | ||||
| 	if ((argc > 6 && sscanf(argv[6], "%30ld", &sample_offset) != 1 && !ast_begins_with(argv[6], "s=")) | ||||
| 	   || (argc > 7 && !ast_begins_with(argv[7], "s="))) { | ||||
| 		res = ast_streamfile(chan, "beep", ast_channel_language(chan)); | ||||
| 	} | ||||
|  | ||||
| 	if (!res) | ||||
| 		res = ast_waitstream(chan, argv[4]); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user