aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-09 18:08:00 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-09 18:08:00 +0000
commit9da3fa7b4b8058bea39433c48f730647f05539a2 (patch)
tree14e1099bb34372dfed09ee5e14412e14a27c8fee /apps
parent6d6ac2aee9411516401f1a4e80d8e69046fe2178 (diff)
Handle hangup during recording of screened name (issue #7304 reported by kulldominique)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@33294 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 4481910fb..130006f6e 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -982,9 +982,18 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
"At the tone, please say your name:"
*/
- ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0); /* NOTE: I've reduced the total time to 4 sec */
- /* don't think we'll need a lock removed, we took care of
- conflicts by naming the privintro file */
+ res = ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0); /* NOTE: I've reduced the total time to */
+ /* 4 sec don't think we'll need a lock removed, we
+ took care of conflicts by naming the privintro file */
+ if (res == -1) {
+ /* Delete the file regardless since they hung up during recording */
+ ast_filedelete(privintro, NULL);
+ if( ast_fileexists(privintro,NULL,NULL ) > 0 )
+ ast_log(LOG_NOTICE,"privacy: ast_filedelete didn't do its job on %s\n", privintro);
+ else if (option_verbose > 2)
+ ast_verbose( VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", privintro);
+ goto out;
+ }
}
}
}
@@ -1258,18 +1267,18 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
do {
if (!res2)
res2 = ast_play_and_wait(peer,"priv-callpending");
- if( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
+ if ( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
res2 = 0;
/* priv-callpending script:
"I have a caller waiting, who introduces themselves as:"
*/
if (!res2)
- res2 = ast_play_and_wait(peer,privintro);
- if( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
+ res2 = ast_play_and_wait(peer, privintro);
+ if ( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
res2 = 0;
/* now get input from the called party, as to their choice */
- if( !res2 ) {
+ if (!res2) {
if( ast_test_flag(&opts, OPT_PRIVACY) )
res2 = ast_play_and_wait(peer,"priv-callee-options");
if( ast_test_flag(&opts, OPT_SCREENING) )