mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-06 13:07:21 +00:00
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
This commit is contained in:
committed by
github-actions[bot]
parent
559ea45ddd
commit
a96d7fcfaf
@@ -2421,6 +2421,7 @@ static void *__analog_ss_thread(void *data)
|
|||||||
}
|
}
|
||||||
while (len < AST_MAX_EXTENSION-1) {
|
while (len < AST_MAX_EXTENSION-1) {
|
||||||
int is_exten_parking = 0;
|
int is_exten_parking = 0;
|
||||||
|
int is_lastnumredial = 0;
|
||||||
|
|
||||||
/* Read digit unless it's supposed to be immediate, in which case the
|
/* Read digit unless it's supposed to be immediate, in which case the
|
||||||
only answer is 's' */
|
only answer is 's' */
|
||||||
@@ -2455,6 +2456,9 @@ static void *__analog_ss_thread(void *data)
|
|||||||
analog_lock_private(p);
|
analog_lock_private(p);
|
||||||
ast_copy_string(exten, p->lastexten, sizeof(exten));
|
ast_copy_string(exten, p->lastexten, sizeof(exten));
|
||||||
analog_unlock_private(p);
|
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 {
|
} else {
|
||||||
ast_verb(3, "Last Number Redial not possible on channel %d (no saved number)\n", p->channel);
|
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);
|
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 (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) {
|
if (getforward) {
|
||||||
/* Record this as the forwarding extension */
|
/* Record this as the forwarding extension */
|
||||||
analog_lock_private(p);
|
analog_lock_private(p);
|
||||||
|
Reference in New Issue
Block a user