mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Add 's' option to ChanSpy, which makes the app exit when no channels are left to spy on.
(closes issue #14594) Reported by: JimDickenson Patches: chanspy.diff uploaded by JimDickenson (license 710) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -60,6 +60,9 @@ Applications
|
|||||||
exit the application.
|
exit the application.
|
||||||
* The Voicemail application has been improved to automatically ignore messages
|
* The Voicemail application has been improved to automatically ignore messages
|
||||||
that only contain silence.
|
that only contain silence.
|
||||||
|
* The ChanSpy application now has the 's' option, which makes the application
|
||||||
|
automatically exit once it hits a point where no more channels are available
|
||||||
|
to spy on.
|
||||||
|
|
||||||
Dialplan Functions
|
Dialplan Functions
|
||||||
------------------
|
------------------
|
||||||
|
@@ -135,6 +135,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
<option name="o">
|
<option name="o">
|
||||||
<para>Only listen to audio coming from this channel.</para>
|
<para>Only listen to audio coming from this channel.</para>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="s">
|
||||||
|
<para>Stop when no more channels are left to spy on.</para>
|
||||||
|
</option>
|
||||||
<option name="X">
|
<option name="X">
|
||||||
<para>Allow the user to exit ChanSpy to a valid single digit
|
<para>Allow the user to exit ChanSpy to a valid single digit
|
||||||
numeric extension in the current context or the context
|
numeric extension in the current context or the context
|
||||||
@@ -266,6 +269,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
<option name="o">
|
<option name="o">
|
||||||
<para>Only listen to audio coming from this channel.</para>
|
<para>Only listen to audio coming from this channel.</para>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="s">
|
||||||
|
<para>Stop when there are no more extensions left to spy on.</para>
|
||||||
|
</option>
|
||||||
<option name="X">
|
<option name="X">
|
||||||
<para>Allow the user to exit ChanSpy to a valid single digit
|
<para>Allow the user to exit ChanSpy to a valid single digit
|
||||||
numeric extension in the current context or the context
|
numeric extension in the current context or the context
|
||||||
@@ -349,6 +355,7 @@ enum {
|
|||||||
OPTION_DTMF_EXIT = (1 << 14), /* Set DTMF to exit, added for DAHDIScan integration */
|
OPTION_DTMF_EXIT = (1 << 14), /* Set DTMF to exit, added for DAHDIScan integration */
|
||||||
OPTION_DTMF_CYCLE = (1 << 15), /* Custom DTMF for cycling next avaliable channel, (default is '*') */
|
OPTION_DTMF_CYCLE = (1 << 15), /* Custom DTMF for cycling next avaliable channel, (default is '*') */
|
||||||
OPTION_DAHDI_SCAN = (1 << 16), /* Scan groups in DAHDIScan mode */
|
OPTION_DAHDI_SCAN = (1 << 16), /* Scan groups in DAHDIScan mode */
|
||||||
|
OPTION_STOP = (1 << 17),
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -373,6 +380,7 @@ AST_APP_OPTIONS(spy_opts, {
|
|||||||
AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
|
AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
|
||||||
AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
|
AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
|
||||||
AST_APP_OPTION('o', OPTION_READONLY),
|
AST_APP_OPTION('o', OPTION_READONLY),
|
||||||
|
AST_APP_OPTION('s', OPTION_STOP),
|
||||||
AST_APP_OPTION('X', OPTION_EXIT),
|
AST_APP_OPTION('X', OPTION_EXIT),
|
||||||
AST_APP_OPTION('s', OPTION_NOTECH),
|
AST_APP_OPTION('s', OPTION_NOTECH),
|
||||||
AST_APP_OPTION_ARG('n', OPTION_NAME, OPT_ARG_NAME),
|
AST_APP_OPTION_ARG('n', OPTION_NAME, OPT_ARG_NAME),
|
||||||
@@ -956,6 +964,9 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags,
|
|||||||
|
|
||||||
if (res == -1 || ast_check_hangup(chan))
|
if (res == -1 || ast_check_hangup(chan))
|
||||||
break;
|
break;
|
||||||
|
if (ast_test_flag(flags, OPTION_STOP) && !next_autochan) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user