]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
sig_analog: Eliminate potential timeout with Last Number Redial.
authorNaveen Albert <asterisk@phreaknet.org>
Mon, 29 Sep 2025 14:10:23 +0000 (10:10 -0400)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 30 Sep 2025 15:09:14 +0000 (15:09 +0000)
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

index 580115c3db7a1278cce4cc2f3703a6fc755fae7a..879007658d04f9556ffd49dad31be0f2b61aeec1 100644 (file)
@@ -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);