From a96d7fcfaf1494d582da6087ded3361dd1c8c784 Mon Sep 17 00:00:00 2001 From: Naveen Albert Date: Mon, 29 Sep 2025 10:10:23 -0400 Subject: [PATCH] sig_analog: Eliminate potential timeout with Last Number Redial. If Last Number Redial is used to redial, ensure that we do not wait for further digits. This was possible if the number that was last dialed is a prefix of another possible dialplan match. Since all we did is copy the number into the extension buffer, if other matches are now possible, there would thus be a timeout before the call went through. We now complete redialed calls immediaetly in all cases. Resolves: #1483 --- channels/sig_analog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/channels/sig_analog.c b/channels/sig_analog.c index 580115c3db..879007658d 100644 --- a/channels/sig_analog.c +++ b/channels/sig_analog.c @@ -2421,6 +2421,7 @@ static void *__analog_ss_thread(void *data) } while (len < AST_MAX_EXTENSION-1) { int is_exten_parking = 0; + int is_lastnumredial = 0; /* Read digit unless it's supposed to be immediate, in which case the only answer is 's' */ @@ -2455,6 +2456,9 @@ static void *__analog_ss_thread(void *data) analog_lock_private(p); ast_copy_string(exten, p->lastexten, sizeof(exten)); analog_unlock_private(p); + /* If Last Number Redial was used, even if the user might normally be able to dial further + * digits for the digits dialed, we should complete the call immediately without delay. */ + is_lastnumredial = 1; } else { ast_verb(3, "Last Number Redial not possible on channel %d (no saved number)\n", p->channel); res = analog_play_tone(p, idx, ANALOG_TONE_CONGESTION); @@ -2464,7 +2468,7 @@ static void *__analog_ss_thread(void *data) } } if (ast_exists_extension(chan, ast_channel_context(chan), exten, 1, p->cid_num) && !is_exten_parking) { - if (!res || !ast_matchmore_extension(chan, ast_channel_context(chan), exten, 1, p->cid_num)) { + if (!res || is_lastnumredial || !ast_matchmore_extension(chan, ast_channel_context(chan), exten, 1, p->cid_num)) { if (getforward) { /* Record this as the forwarding extension */ analog_lock_private(p); -- 2.47.3