[Asterisk-code-review] app_bridgewait: Add option to not answer channel. (asterisk[18])

Friendly Automation asteriskteam at digium.com
Mon Sep 26 10:41:52 CDT 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19325 )

Change subject: app_bridgewait: Add option to not answer channel.
......................................................................

app_bridgewait: Add option to not answer channel.

Adds the n option to not answer the channel when calling
BridgeWait, so the application can be used without
forcing answer supervision.

ASTERISK-30216 #close

Change-Id: I6b85ef300b1f7b5170f8537e2b10889cc2e6605a
---
M apps/app_bridgewait.c
A doc/CHANGES-staging/app_bridgewait.txt
2 files changed, 26 insertions(+), 2 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit




diff --git a/apps/app_bridgewait.c b/apps/app_bridgewait.c
index 9326ed1..86a4f7b 100644
--- a/apps/app_bridgewait.c
+++ b/apps/app_bridgewait.c
@@ -100,6 +100,9 @@
 						<para>Automatically exit the bridge and return to the PBX after
 						<emphasis>duration</emphasis> seconds.</para>
 					</option>
+					<option name="n">
+						<para>Do not automatically answer the channel.</para>
+					</option>
 				</optionlist>
 			</parameter>
 		</syntax>
@@ -108,7 +111,7 @@
 			The channel will then wait in the holding bridge until some event occurs
 			which removes it from the holding bridge.</para>
 			<note><para>This application will answer calls which haven't already
-			been answered.</para></note>
+			been answered, unless the n option is provided.</para></note>
 		</description>
 	</application>
  ***/
@@ -186,6 +189,7 @@
 	MUXFLAG_MOHCLASS = (1 << 0),
 	MUXFLAG_ENTERTAINMENT = (1 << 1),
 	MUXFLAG_TIMEOUT = (1 << 2),
+	MUXFLAG_NOANSWER = (1 << 3),
 };
 
 enum bridgewait_args {
@@ -199,6 +203,7 @@
 	AST_APP_OPTION_ARG('e', MUXFLAG_ENTERTAINMENT, OPT_ARG_ENTERTAINMENT),
 	AST_APP_OPTION_ARG('m', MUXFLAG_MOHCLASS, OPT_ARG_MOHCLASS),
 	AST_APP_OPTION_ARG('S', MUXFLAG_TIMEOUT, OPT_ARG_TIMEOUT),
+	AST_APP_OPTION('n', MUXFLAG_NOANSWER),
 });
 
 static int bridgewait_timeout_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
@@ -458,7 +463,7 @@
 	}
 
 	/* Answer the channel if needed */
-	if (ast_channel_state(chan) != AST_STATE_UP) {
+	if (ast_channel_state(chan) != AST_STATE_UP && !ast_test_flag(&flags, MUXFLAG_NOANSWER)) {
 		ast_answer(chan);
 	}
 
diff --git a/doc/CHANGES-staging/app_bridgewait.txt b/doc/CHANGES-staging/app_bridgewait.txt
new file mode 100644
index 0000000..aa2e00b
--- /dev/null
+++ b/doc/CHANGES-staging/app_bridgewait.txt
@@ -0,0 +1,4 @@
+Subject: app_bridgewait
+
+Adds the n option to not answer the channel when
+the BridgeWait application is called.

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19325
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I6b85ef300b1f7b5170f8537e2b10889cc2e6605a
Gerrit-Change-Number: 19325
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220926/4adf4446/attachment.html>


More information about the asterisk-code-review mailing list