aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-02 18:12:08 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-02 18:12:08 +0000
commit04aadd76161e3a6e1dde98f0776372c0590b4ac5 (patch)
treecf775d4a1be6e380a22b587113524c029ce00239 /apps/app_dial.c
parent7327fcee77db3e04f77ce7b08f2057c08cd155e7 (diff)
Merged revisions 226890 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r226890 | file | 2009-11-02 14:08:54 -0400 (Mon, 02 Nov 2009) | 18 lines Merged revisions 226889 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r226889 | file | 2009-11-02 14:08:11 -0400 (Mon, 02 Nov 2009) | 11 lines Fix a bug where the recorded privacy introduction file would not get removed if the caller hung up while the called party had not yet answered. This was fixed by introducing an argument to the 'n' option which, when enabled, removes the introduction file under all scenarios. This was done to preserve the behavior that has existed for quite some time. (closes issue #14674) Reported by: ulogic Patches: bug14674.patch uploaded by jpeeler (license 325) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@226893 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 5ccded663..5c54d7e5b 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -253,6 +253,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
Macro()</para></warning>
</option>
<option name="n">
+ <argument name="delete">
+ <para>With <replaceable>delete</replaceable> either not specified or set to <literal>0</literal>,
+ the recorded introduction will not be deleted if the caller hangs up while the remote party has not
+ yet answered.</para>
+ <para>With <replaceable>delete</replaceable> set to <literal>1</literal>, the introduction will
+ always be deleted.</para>
+ </argument>
<para>This option is a modifier for the call screening/privacy mode. (See the
<literal>p</literal> and <literal>P</literal> options.) It specifies
that no introductions are to be saved in the <directory>priv-callerintros</directory>
@@ -507,6 +514,7 @@ enum {
OPT_ARG_PRIVACY,
OPT_ARG_DURATION_STOP,
OPT_ARG_OPERMODE,
+ OPT_ARG_SCREEN_NOINTRO,
/* note: this entry _MUST_ be the last one in the enum */
OPT_ARG_ARRAY_SIZE,
};
@@ -530,7 +538,7 @@ AST_APP_OPTIONS(dial_exec_options, BEGIN_OPTIONS
AST_APP_OPTION_ARG('L', OPT_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT),
AST_APP_OPTION_ARG('m', OPT_MUSICBACK, OPT_ARG_MUSICBACK),
AST_APP_OPTION_ARG('M', OPT_CALLEE_MACRO, OPT_ARG_CALLEE_MACRO),
- AST_APP_OPTION('n', OPT_SCREEN_NOINTRO),
+ AST_APP_OPTION_ARG('n', OPT_SCREEN_NOINTRO, OPT_ARG_SCREEN_NOINTRO),
AST_APP_OPTION('N', OPT_SCREEN_NOCLID),
AST_APP_OPTION('o', OPT_ORIGINAL_CLID),
AST_APP_OPTION_ARG('O', OPT_OPERMODE, OPT_ARG_OPERMODE),
@@ -1529,6 +1537,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
int result = 0;
char *parse;
int opermode = 0;
+ int delprivintro = 0;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(peers);
AST_APP_ARG(timeout);
@@ -1570,6 +1579,15 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
}
+ if (ast_test_flag64(&opts, OPT_SCREEN_NOINTRO) && !ast_strlen_zero(opt_args[OPT_ARG_SCREEN_NOINTRO])) {
+ delprivintro = atoi(opt_args[OPT_ARG_SCREEN_NOINTRO]);
+
+ if (delprivintro < 0 || delprivintro > 1) {
+ ast_log(LOG_WARNING, "Unknown argument %d specified to n option, ignoring\n", delprivintro);
+ delprivintro = 0;
+ }
+ }
+
if (ast_test_flag64(&opts, OPT_OPERMODE)) {
opermode = ast_strlen_zero(opt_args[OPT_ARG_OPERMODE]) ? 1 : atoi(opt_args[OPT_ARG_OPERMODE]);
ast_verb(3, "Setting operator services mode to %d.\n", opermode);
@@ -2231,6 +2249,16 @@ out:
sentringing = 0;
ast_indicate(chan, -1);
}
+
+ if (delprivintro && ast_fileexists(pa.privintro, NULL, NULL) > 0) {
+ ast_filedelete(pa.privintro, NULL);
+ if (ast_fileexists(pa.privintro, NULL, NULL) > 0) {
+ ast_log(LOG_NOTICE, "privacy: ast_filedelete didn't do its job on %s\n", pa.privintro);
+ } else {
+ ast_verb(3, "Successfully deleted %s intro file\n", pa.privintro);
+ }
+ }
+
ast_channel_early_bridge(chan, NULL);
hanguptree(outgoing, NULL, 0); /* In this case, there's no answer anywhere */
pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);