<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15899">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_confbridge: New option to prevent answer supervision<br><br>A new user option, answer_channel, adds the capability to<br>prevent answering the channel if it hasn't already been<br>answered yet.<br><br>ASTERISK-29440<br><br>Change-Id: I26642729d0345f178c7b8045506605c8402de54b<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>A doc/CHANGES-staging/app_confbridge_answer.txt<br>5 files changed, 25 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/99/15899/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 8ad188a..651e2dd 100644</span><br><span>--- a/apps/app_confbridge.c</span><br><span>+++ b/apps/app_confbridge.c</span><br><span>@@ -2535,10 +2535,6 @@</span><br><span> AST_APP_ARG(menu_profile_name);</span><br><span> );</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_channel_state(chan) != AST_STATE_UP) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_answer(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> if (ast_bridge_features_init(&user.features)) {</span><br><span> pbx_builtin_setvar_helper(chan, "CONFBRIDGE_RESULT", "FAILED");</span><br><span> res = -1;</span><br><span>@@ -2588,6 +2584,11 @@</span><br><span> goto confbridge_cleanup;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* If channel hasn't been answered already, answer it, unless we're explicitly not supposed to */</span><br><span style="color: hsl(120, 100%, 40%);">+ if ((ast_channel_state(chan) != AST_STATE_UP) && !(ast_test_flag(&user.u_profile, USER_OPT_NOANSWER))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_answer(chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> quiet = ast_test_flag(&user.u_profile, USER_OPT_QUIET);</span><br><span> </span><br><span> /* ask for a PIN immediately after finding user profile. This has to be</span><br><span>diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c</span><br><span>index 656acc6..841d06a 100644</span><br><span>--- a/apps/confbridge/conf_config_parser.c</span><br><span>+++ b/apps/confbridge/conf_config_parser.c</span><br><span>@@ -247,6 +247,9 @@</span><br><span> participants in the conference bridge. If disabled then no text</span><br><span> messages are sent to the user.</para></description></span><br><span> </configOption></span><br><span style="color: hsl(120, 100%, 40%);">+ <configOption name="answer_channel" default="yes"></span><br><span style="color: hsl(120, 100%, 40%);">+ <synopsis>Sets if a user's channel should be answered if currently unanswered.</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ </configOption></span><br><span> </configObject></span><br><span> <configObject name="bridge_profile"></span><br><span> <synopsis>A named profile to apply to specific bridges.</synopsis></span><br><span>@@ -1609,9 +1612,12 @@</span><br><span> ast_cli(a->fd,"Announce User Count all: %s\n",</span><br><span> u_profile.flags & USER_OPT_ANNOUNCEUSERCOUNTALL ?</span><br><span> "enabled" : "disabled");</span><br><span style="color: hsl(0, 100%, 40%);">- ast_cli(a->fd,"Text Messaging: %s\n",</span><br><span style="color: hsl(0, 100%, 40%);">- u_profile.flags & USER_OPT_TEXT_MESSAGING ?</span><br><span style="color: hsl(0, 100%, 40%);">- "enabled" : "disabled");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_cli(a->fd,"Text Messaging: %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ u_profile.flags & USER_OPT_TEXT_MESSAGING ?</span><br><span style="color: hsl(120, 100%, 40%);">+ "enabled" : "disabled");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_cli(a->fd,"Answer Channel: %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ u_profile.flags & USER_OPT_NOANSWER ?</span><br><span style="color: hsl(120, 100%, 40%);">+ "true" : "false");</span><br><span> ast_cli(a->fd, "\n");</span><br><span> </span><br><span> return CLI_SUCCESS;</span><br><span>@@ -2410,6 +2416,8 @@</span><br><span> aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_JITTERBUFFER);</span><br><span> aco_option_register(&cfg_info, "timeout", ACO_EXACT, user_types, "0", OPT_UINT_T, 0, FLDSET(struct user_profile, timeout));</span><br><span> aco_option_register(&cfg_info, "text_messaging", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_TEXT_MESSAGING);</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOANSWER is cleared */</span><br><span style="color: hsl(120, 100%, 40%);">+ aco_option_register(&cfg_info, "answer_channel", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 0, FLDSET(struct user_profile, flags), USER_OPT_NOANSWER);</span><br><span> </span><br><span> /* This option should only be used with the CONFBRIDGE dialplan function */</span><br><span> aco_option_register_custom(&cfg_info, "template", ACO_EXACT, user_types, NULL, user_template_handler, 0);</span><br><span>diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h</span><br><span>index f413359..4b8690a 100644</span><br><span>--- a/apps/confbridge/include/confbridge.h</span><br><span>+++ b/apps/confbridge/include/confbridge.h</span><br><span>@@ -69,6 +69,7 @@</span><br><span> USER_OPT_SEND_EVENTS = (1 << 17), /*!< Send text message events to users */</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 style="color: hsl(120, 100%, 40%);">+ USER_OPT_NOANSWER = (1 << 20), /*!< Sets if the channel should be answered if currently unanswered */</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 7749c93..eecbb65 100644</span><br><span>--- a/configs/samples/confbridge.conf.sample</span><br><span>+++ b/configs/samples/confbridge.conf.sample</span><br><span>@@ -165,6 +165,8 @@</span><br><span> ;text_messaging=yes ; When set to yes text messages will be sent to this user. Text messages</span><br><span> ; may occur as a result of events or can be received from other participants.</span><br><span> ; When set to no text messages will not be sent to this user.</span><br><span style="color: hsl(120, 100%, 40%);">+;answer_channel=yes ; Sets if the channel should be answered if it hasn't been already.</span><br><span style="color: hsl(120, 100%, 40%);">+ ; On by default.</span><br><span> </span><br><span> ; --- ConfBridge Bridge Profile Options ---</span><br><span> [default_bridge]</span><br><span>diff --git a/doc/CHANGES-staging/app_confbridge_answer.txt b/doc/CHANGES-staging/app_confbridge_answer.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..b975f48</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_confbridge_answer.txt</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_confbridge answer supervision control</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+app_confbridge now provides a user option to prevent</span><br><span style="color: hsl(120, 100%, 40%);">+answer supervision if the channel hasn't been</span><br><span style="color: hsl(120, 100%, 40%);">+answered yet. To use it, set a user profile's</span><br><span style="color: hsl(120, 100%, 40%);">+answer_channel option to no.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15899">change 15899</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/+/15899"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I26642729d0345f178c7b8045506605c8402de54b </div>
<div style="display:none"> Gerrit-Change-Number: 15899 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>