mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	apps/confbridge: Added hear_own_join_sound option to control who hears sound_join
Added the hear_own_join_sound option to the confbridge user profile to control who hears the sound_join audio file. When set to 'yes' the user entering the conference and the participants already in the conference will hear the sound_join audio file. When set to 'no' the user entering the conference will not hear the sound_join audio file, but the participants already in the conference will hear the sound_join audio file. ASTERISK-29931 Added by Michael Cargile Change-Id: I856bd66dc0dfa057323860a6418c1371d249abd2
This commit is contained in:
		
				
					committed by
					
						 Joshua Colp
						Joshua Colp
					
				
			
			
				
	
			
			
			
						parent
						
							2391af167b
						
					
				
				
					commit
					72c8c263e8
				
			| @@ -2725,17 +2725,24 @@ static int confbridge_exec(struct ast_channel *chan, const char *data) | ||||
| 		ast_autoservice_stop(chan); | ||||
| 	} | ||||
|  | ||||
| 	/* Play the Join sound to both the conference and the user entering. */ | ||||
| 	if (!quiet) { | ||||
| 		const char *join_sound = conf_get_sound(CONF_SOUND_JOIN, conference->b_profile.sounds); | ||||
|  | ||||
| 		if (strcmp(conference->b_profile.language, ast_channel_language(chan))) { | ||||
| 			ast_stream_and_wait(chan, join_sound, ""); | ||||
| 		/* if hear_own_join_sound is enabled play the Join sound to everyone */ | ||||
| 		if (ast_test_flag(&user.u_profile, USER_OPT_HEAR_OWN_JOIN_SOUND) ) { | ||||
| 			if (strcmp(conference->b_profile.language, ast_channel_language(chan))) { | ||||
| 				ast_stream_and_wait(chan, join_sound, ""); | ||||
| 				ast_autoservice_start(chan); | ||||
| 				play_sound_file(conference, join_sound); | ||||
| 				ast_autoservice_stop(chan); | ||||
| 			} else { | ||||
| 				async_play_sound_file(conference, join_sound, chan); | ||||
| 			} | ||||
| 		/* if hear_own_join_sound is disabled only play the Join sound to just the conference */ | ||||
| 		} else { | ||||
| 			ast_autoservice_start(chan); | ||||
| 			play_sound_file(conference, join_sound); | ||||
| 			ast_autoservice_stop(chan); | ||||
| 		} else { | ||||
| 			async_play_sound_file(conference, join_sound, chan); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -97,6 +97,9 @@ | ||||
| 				<configOption name="quiet"> | ||||
| 					<synopsis>Silence enter/leave prompts and user intros for this user</synopsis> | ||||
| 				</configOption> | ||||
| 				<configOption name="hear_own_join_sound"> | ||||
| 					<synopsis>Determines if the user also hears the join sound when they enter a conference</synopsis> | ||||
| 				</configOption> | ||||
| 				<configOption name="announce_user_count"> | ||||
| 					<synopsis>Sets if the number of users should be announced to the user</synopsis> | ||||
| 				</configOption> | ||||
| @@ -1574,6 +1577,9 @@ static char *handle_cli_confbridge_show_user_profile(struct ast_cli_entry *e, in | ||||
| 	ast_cli(a->fd,"Quiet:                   %s\n", | ||||
| 		u_profile.flags & USER_OPT_QUIET ? | ||||
| 		"enabled" : "disabled"); | ||||
| 	ast_cli(a->fd,"Hear Join:               %s\n", | ||||
| 		u_profile.flags & USER_OPT_HEAR_OWN_JOIN_SOUND ? | ||||
| 		"enabled" : "disabled"); | ||||
| 	ast_cli(a->fd,"Wait Marked:             %s\n", | ||||
| 		u_profile.flags & USER_OPT_WAITMARKED ? | ||||
| 		"enabled" : "disabled"); | ||||
| @@ -2396,6 +2402,7 @@ int conf_load_config(void) | ||||
| 	aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED); | ||||
| 	aco_option_register(&cfg_info, "music_on_hold_when_empty", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MUSICONHOLD); | ||||
| 	aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET); | ||||
| 	aco_option_register(&cfg_info, "hear_own_join_sound", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_HEAR_OWN_JOIN_SOUND); | ||||
| 	aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0); | ||||
| 	aco_option_register(&cfg_info, "announce_user_count", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ANNOUNCEUSERCOUNT); | ||||
| 	/* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOONLYPERSON is cleared */ | ||||
|   | ||||
| @@ -70,6 +70,7 @@ enum user_profile_flags { | ||||
| 	USER_OPT_ECHO_EVENTS = (1 << 18), /*!< Send events only to the admin(s) */ | ||||
| 	USER_OPT_TEXT_MESSAGING = (1 << 19), /*!< Send text messages to the user */ | ||||
| 	USER_OPT_ANSWER_CHANNEL = (1 << 20), /*!< Sets if the channel should be answered if currently unanswered */ | ||||
| 	USER_OPT_HEAR_OWN_JOIN_SOUND  = (1 << 21), /*!< Set if the caller should hear the join sound */ | ||||
| }; | ||||
|  | ||||
| enum bridge_profile_flags { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user