aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-09 18:12:46 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-09 18:12:46 +0000
commit75258205b94e2233d9c720855aa4a6d599a8f63c (patch)
tree125d61dc66870b6a8e571656723111e0daa5cf23 /apps/app_dial.c
parent10c2693549f8ea63da9cd6ca303cd42734250ea6 (diff)
Merged revisions 33294 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r33294 | file | 2006-06-09 15:08:00 -0300 (Fri, 09 Jun 2006) | 2 lines Handle hangup during recording of screened name (issue #7304 reported by kulldominique) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33295 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 5361bdc6a..a5afc5127 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1017,11 +1017,20 @@ 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 */
+ 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( !ast_streamfile(chan, "vm-dialout", chan->language) )
- ast_waitstream(chan, "");
+ 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;
+ }
+ if( !ast_streamfile(chan, "vm-dialout", chan->language) )
+ ast_waitstream(chan, "");
}
}
}
@@ -1279,7 +1288,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
res2 = ast_play_and_wait(peer,"priv-callpending");
if (!valid_priv_reply(&opts, res2))
res2 = 0;
-
/* priv-callpending script:
"I have a caller waiting, who introduces themselves as:"
*/