struct cause_args num = *num_in;
int prestart = num.busy + num.congestion + num.nochan;
int orig_answer_to = *to_answer;
- int progress_to_dup = *to_progress;
int orig_progress_to = *to_progress;
struct ast_channel *peer = NULL;
struct chanlist *outgoing = AST_LIST_FIRST(out_chans);
is_cc_recall = ast_cc_is_recall(in, &cc_recall_core_id, NULL);
- while ((*to_answer = ast_remaining_ms(start, orig_answer_to)) && (*to_progress = ast_remaining_ms(start, progress_to_dup)) && !peer) {
+ while ((*to_answer = ast_remaining_ms(start, orig_answer_to)) && (*to_progress = ast_remaining_ms(start, orig_progress_to)) && !peer) {
struct chanlist *o;
int pos = 0; /* how many channels do we handle */
int numlines = prestart;
}
SCOPE_EXIT_RTN_VALUE(NULL, "%s: No outgoing channels available\n", ast_channel_name(in));
}
- winner = ast_waitfor_n(watchers, pos, to_answer);
+
+ /* If progress timeout is active, use that if it's the shorter of the 2 timeouts. */
+ winner = ast_waitfor_n(watchers, pos, *to_progress > 0 && *to_progress < *to_answer ? to_progress : to_answer);
+
AST_LIST_TRAVERSE(out_chans, o, node) {
int res = 0;
struct ast_frame *f;
*/
++num_ringing;
*to_progress = -1;
- progress_to_dup = -1;
+ orig_progress_to = -1;
if (ignore_cc || cc_frame_received || num_ringing == numlines) {
ast_verb(3, "%s is ringing\n", ast_channel_name(c));
/* Setup early media if appropriate */
}
}
*to_progress = -1;
- progress_to_dup = -1;
+ orig_progress_to = -1;
if (!sent_progress) {
struct timeval now, then;
int64_t diff;
break;
}
*to_progress = -1;
- progress_to_dup = -1;
+ orig_progress_to = -1;
/* Fall through */
case AST_FRAME_TEXT:
if (single && ast_write(in, f)) {