aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-16 12:23:13 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-16 12:23:13 +0000
commit1152ea8b179c971748e8b3abae8f923d6045a47b (patch)
tree85518a6738bbf103703590d8e5c95deb9e55a271 /apps/app_chanspy.c
parent67c7e1e162e4d22532d4bcf7ef218b9b41308d6a (diff)
Add the ability to disable channel technology name playback when speaking the current channel name
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114165 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index c764f029f..997a7d920 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -77,6 +77,8 @@ static const char *desc_chan =
" r[(basename)] - Record the session to the monitor spool directory. An\n"
" optional base for the filename may be specified. The\n"
" default is 'chanspy'.\n"
+" s - Skip the playback of the channel type (i.e. SIP, IAX, etc) when\n"
+" speaking the selected channel name.\n"
" v([value]) - Adjust the initial volume in the range from -4 to 4. A\n"
" negative value refers to a quieter setting.\n"
" w - Enable 'whisper' mode, so the spying channel can talk to\n"
@@ -117,6 +119,8 @@ static const char *desc_ext =
" r[(basename)] - Record the session to the monitor spool directory. An\n"
" optional base for the filename may be specified. The\n"
" default is 'chanspy'.\n"
+" s - Skip the playback of the channel type (i.e. SIP, IAX, etc) when\n"
+" speaking the selected channel name.\n"
" v([value]) - Adjust the initial volume in the range from -4 to 4. A\n"
" negative value refers to a quieter setting.\n"
" w - Enable 'whisper' mode, so the spying channel can talk to\n"
@@ -143,6 +147,7 @@ enum {
OPTION_READONLY = (1 << 7), /* Don't mix the two channels */
OPTION_EXIT = (1 << 8), /* Exit to a valid single digit extension */
OPTION_ENFORCED = (1 << 9), /* Enforced mode */
+ OPTION_NOTECH = (1 << 10), /* Skip technology name playback */
} chanspy_opt_flags;
enum {
@@ -164,6 +169,7 @@ AST_APP_OPTIONS(spy_opts, {
AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
AST_APP_OPTION('o', OPTION_READONLY),
AST_APP_OPTION('X', OPTION_EXIT),
+ AST_APP_OPTION('s', OPTION_NOTECH),
});
@@ -708,16 +714,20 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
peer = NULL;
if (!ast_test_flag(flags, OPTION_QUIET)) {
- if (ast_fileexists(peer_name, NULL, NULL) != -1) {
- res = ast_streamfile(chan, peer_name, chan->language);
- if (!res)
- res = ast_waitstream(chan, "");
- if (res) {
- chanspy_ds_free(peer_chanspy_ds);
- break;
+ if (!ast_test_flag(flags, OPTION_NOTECH)) {
+ if (ast_fileexists(peer_name, NULL, NULL) != -1) {
+ res = ast_streamfile(chan, peer_name, chan->language);
+ if (!res) {
+ res = ast_waitstream(chan, "");
+ }
+ if (res) {
+ chanspy_ds_free(peer_chanspy_ds);
+ break;
+ }
+ } else {
+ res = ast_say_character_str(chan, peer_name, "", chan->language);
}
- } else
- res = ast_say_character_str(chan, peer_name, "", chan->language);
+ }
if ((num = atoi(ptr)))
ast_say_digits(chan, atoi(ptr), "", chan->language);
}