<p>Michael Cargile has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18072">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">apps/confbridge: Added hearjoin option to control who hears sound_join<br><br>Added the hearjoin option to the confbridge user profile to control who<br>hears the sound_join audio file. When set to 'yes' the user entering<br>the conference and the participants already in the conference will hear<br>the sound_join audio file. When set to 'no' the user entering the<br>conference will not hear the sound_join audio file, but the participants<br>already in the conference will hear the sound_join audio file.<br><br>ASTERISK-29931<br>Added by Michael Cargile<br><br>Change-Id: I856bd66dc0dfa057323860a6418c1371d249abd2<br>---<br>M apps/app_confbridge.c<br>M apps/confbridge/conf_config_parser.c<br>M apps/confbridge/include/confbridge.h<br>M configs/samples/confbridge.conf.sample<br>4 files changed, 24 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/72/18072/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c</span><br><span>index 2eaae41..4c70746 100644</span><br><span>--- a/apps/app_confbridge.c</span><br><span>+++ b/apps/app_confbridge.c</span><br><span>@@ -2724,13 +2724,19 @@</span><br><span> if (!quiet) {</span><br><span> const char *join_sound = conf_get_sound(CONF_SOUND_JOIN, conference->b_profile.sounds);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (strcmp(conference->b_profile.language, ast_channel_language(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_stream_and_wait(chan, join_sound, "");</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_test_flag(&user.u_profile, USER_OPT_HEAR_JOIN) ) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (strcmp(conference->b_profile.language, ast_channel_language(chan))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_stream_and_wait(chan, join_sound, "");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_autoservice_start(chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ play_sound_file(conference, join_sound);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_autoservice_stop(chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ async_play_sound_file(conference, join_sound, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span> ast_autoservice_start(chan);</span><br><span> play_sound_file(conference, join_sound);</span><br><span> ast_autoservice_stop(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- async_play_sound_file(conference, join_sound, chan);</span><br><span> }</span><br><span> }</span><br><span> </span><br><span>diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c</span><br><span>index 4f58c18..88eb038 100644</span><br><span>--- a/apps/confbridge/conf_config_parser.c</span><br><span>+++ b/apps/confbridge/conf_config_parser.c</span><br><span>@@ -97,6 +97,9 @@</span><br><span> <configOption name="quiet"></span><br><span> <synopsis>Silence enter/leave prompts and user intros for this user</synopsis></span><br><span> </configOption></span><br><span style="color: hsl(120, 100%, 40%);">+ <configOption name="hearjoin"></span><br><span style="color: hsl(120, 100%, 40%);">+ <synopsis>Determines if the user also hears the join sound when they enter a conference</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ </configOption></span><br><span> <configOption name="announce_user_count"></span><br><span> <synopsis>Sets if the number of users should be announced to the user</synopsis></span><br><span> </configOption></span><br><span>@@ -1574,6 +1577,9 @@</span><br><span> ast_cli(a->fd,"Quiet: %s\n",</span><br><span> u_profile.flags & USER_OPT_QUIET ?</span><br><span> "enabled" : "disabled");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_cli(a->fd,"Hear Join: %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ u_profile.flags & USER_OPT_HEAR_JOIN ?</span><br><span style="color: hsl(120, 100%, 40%);">+ "enabled" : "disabled");</span><br><span> ast_cli(a->fd,"Wait Marked: %s\n",</span><br><span> u_profile.flags & USER_OPT_WAITMARKED ?</span><br><span> "enabled" : "disabled");</span><br><span>@@ -2396,6 +2402,7 @@</span><br><span> aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED);</span><br><span> 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);</span><br><span> aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET);</span><br><span style="color: hsl(120, 100%, 40%);">+ aco_option_register(&cfg_info, "hearjoin", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_HEAR_JOIN);</span><br><span> aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0);</span><br><span> 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);</span><br><span> /* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOONLYPERSON is cleared */</span><br><span>diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h</span><br><span>index 95a0732..f86afee 100644</span><br><span>--- a/apps/confbridge/include/confbridge.h</span><br><span>+++ b/apps/confbridge/include/confbridge.h</span><br><span>@@ -70,6 +70,7 @@</span><br><span> USER_OPT_ECHO_EVENTS = (1 << 18), /*!< Send events only to the admin(s) */</span><br><span> USER_OPT_TEXT_MESSAGING = (1 << 19), /*!< Send text messages to the user */</span><br><span> USER_OPT_ANSWER_CHANNEL = (1 << 20), /*!< Sets if the channel should be answered if currently unanswered */</span><br><span style="color: hsl(120, 100%, 40%);">+ USER_OPT_HEAR_JOIN = (1 << 21), /*!< Set if the caller should hear the join sound */</span><br><span> };</span><br><span> </span><br><span> enum bridge_profile_flags {</span><br><span>diff --git a/configs/samples/confbridge.conf.sample b/configs/samples/confbridge.conf.sample</span><br><span>index eecbb65..3f5cba2 100644</span><br><span>--- a/configs/samples/confbridge.conf.sample</span><br><span>+++ b/configs/samples/confbridge.conf.sample</span><br><span>@@ -41,6 +41,12 @@</span><br><span> ; There are some prompts, such as the prompt to enter a PIN number,</span><br><span> ; that must be played regardless of what this option is set to.</span><br><span> ; Off by default</span><br><span style="color: hsl(120, 100%, 40%);">+;hearjoin=yes ; Sets if a user joining the conference should hear the sound_join </span><br><span style="color: hsl(120, 100%, 40%);">+ ; audio sound when they enter the conference. If set to 'no' the </span><br><span style="color: hsl(120, 100%, 40%);">+ ; user will not hear the sound_join audio but the other participants </span><br><span style="color: hsl(120, 100%, 40%);">+ ; in the conference will still hear the audio. If set to 'yes' </span><br><span style="color: hsl(120, 100%, 40%);">+ ; everyone hears the sound_join audio when this user enters the conference. </span><br><span style="color: hsl(120, 100%, 40%);">+ ; On by default</span><br><span> ;announce_user_count=yes ; Sets if the number of users should be announced to the</span><br><span> ; caller. Off by default.</span><br><span> ;announce_user_count_all=yes ; Sets if the number of users should be announced to</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18072">change 18072</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/18072"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I856bd66dc0dfa057323860a6418c1371d249abd2 </div>
<div style="display:none"> Gerrit-Change-Number: 18072 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Cargile <mikec@vicidial.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>