Skip to content

Commit d411ad8

Browse files
InterLinked1Friendly Automation
authored and
Friendly Automation
committed
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
1 parent 41ce371 commit d411ad8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

apps/app_bridgewait.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
<para>Automatically exit the bridge and return to the PBX after
101101
<emphasis>duration</emphasis> seconds.</para>
102102
</option>
103+
<option name="n">
104+
<para>Do not automatically answer the channel.</para>
105+
</option>
103106
</optionlist>
104107
</parameter>
105108
</syntax>
@@ -108,7 +111,7 @@
108111
The channel will then wait in the holding bridge until some event occurs
109112
which removes it from the holding bridge.</para>
110113
<note><para>This application will answer calls which haven't already
111-
been answered.</para></note>
114+
been answered, unless the n option is provided.</para></note>
112115
</description>
113116
</application>
114117
***/
@@ -186,6 +189,7 @@ enum bridgewait_flags {
186189
MUXFLAG_MOHCLASS = (1 << 0),
187190
MUXFLAG_ENTERTAINMENT = (1 << 1),
188191
MUXFLAG_TIMEOUT = (1 << 2),
192+
MUXFLAG_NOANSWER = (1 << 3),
189193
};
190194

191195
enum bridgewait_args {
@@ -199,6 +203,7 @@ AST_APP_OPTIONS(bridgewait_opts, {
199203
AST_APP_OPTION_ARG('e', MUXFLAG_ENTERTAINMENT, OPT_ARG_ENTERTAINMENT),
200204
AST_APP_OPTION_ARG('m', MUXFLAG_MOHCLASS, OPT_ARG_MOHCLASS),
201205
AST_APP_OPTION_ARG('S', MUXFLAG_TIMEOUT, OPT_ARG_TIMEOUT),
206+
AST_APP_OPTION('n', MUXFLAG_NOANSWER),
202207
});
203208

204209
static int bridgewait_timeout_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
@@ -458,7 +463,7 @@ static int bridgewait_exec(struct ast_channel *chan, const char *data)
458463
}
459464

460465
/* Answer the channel if needed */
461-
if (ast_channel_state(chan) != AST_STATE_UP) {
466+
if (ast_channel_state(chan) != AST_STATE_UP && !ast_test_flag(&flags, MUXFLAG_NOANSWER)) {
462467
ast_answer(chan);
463468
}
464469

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Subject: app_bridgewait
2+
3+
Adds the n option to not answer the channel when
4+
the BridgeWait application is called.

0 commit comments

Comments
 (0)