summaryrefslogtreecommitdiff
path: root/apps/app_dial.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 310326dc1..b162a4127 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1116,6 +1116,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
int is_cc_recall;
int cc_frame_received = 0;
int num_ringing = 0;
+ struct timeval start = ast_tvnow();
ast_party_connected_line_init(&connected_caller);
if (single) {
@@ -1158,7 +1159,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
}
#endif
- while (*to && !peer) {
+ while ((*to = ast_remaining_ms(start, orig)) && !peer) {
struct chanlist *o;
int pos = 0; /* how many channels do we handle */
int numlines = prestart;
@@ -1702,10 +1703,13 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
skip_frame:;
ast_frfree(f);
}
- if (!*to)
- ast_verb(3, "Nobody picked up in %d ms\n", orig);
- if (!*to || ast_check_hangup(in))
- ast_cdr_noanswer(ast_channel_cdr(in));
+ }
+
+ if (!*to) {
+ ast_verb(3, "Nobody picked up in %d ms\n", orig);
+ }
+ if (!*to || ast_check_hangup(in)) {
+ ast_cdr_noanswer(ast_channel_cdr(in));
}
#ifdef HAVE_EPOLL