mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	core: Add digit filtering to ast_waitfordigit_full
This adds a parameter to ast_waitfordigit_full which can be used to only stop waiting when certain expected digits are received. Any unexpected DTMF digits are simply ignored. This also creates a new dialplan application WaitDigit. ASTERISK-27129 #close Change-Id: Id233935ea3d13e71c75a0861834c5936c3700ef9
This commit is contained in:
		| @@ -2393,7 +2393,7 @@ static int handle_waitfordigit(struct ast_channel *chan, AGI *agi, int argc, con | ||||
| 		return RESULT_SHOWUSAGE; | ||||
| 	if (sscanf(argv[3], "%30d", &to) != 1) | ||||
| 		return RESULT_SHOWUSAGE; | ||||
| 	res = ast_waitfordigit_full(chan, to, agi->audio, agi->ctrl); | ||||
| 	res = ast_waitfordigit_full(chan, to, NULL, agi->audio, agi->ctrl); | ||||
| 	ast_agi_send(agi->fd, chan, "200 result=%d\n", res); | ||||
| 	return (res >= 0) ? RESULT_SUCCESS : RESULT_FAILURE; | ||||
| } | ||||
| @@ -2673,7 +2673,7 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, const | ||||
|  | ||||
| 	/* If the user didnt press a key, wait for digitTimeout*/ | ||||
| 	if (res == 0 ) { | ||||
| 		res = ast_waitfordigit_full(chan, timeout, agi->audio, agi->ctrl); | ||||
| 		res = ast_waitfordigit_full(chan, timeout, NULL, agi->audio, agi->ctrl); | ||||
| 		/* Make sure the new result is in the escape digits of the GET OPTION */ | ||||
| 		if ( !strchr(edigits,res) ) | ||||
| 			res=0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user