File timeout_reset_dial_app-18.24.3.patch of Package asterisk

--- asterisk-18.24.3/apps/app_dial.c	2024-09-05 12:57:24.000000000 -0400
+++ asterisk-18.24.3-vici/apps/app_dial.c	2024-09-16 23:03:20.383828910 -0400
@@ -1285,6 +1285,7 @@
 	int cc_frame_received = 0;
 	int num_ringing = 0;
 	int sent_ring = 0;
+	int to_reset = 0;
 	int sent_progress = 0, sent_wink = 0;
 	struct timeval start = ast_tvnow();
 	SCOPE_ENTER(3, "%s\n", ast_channel_name(in));
@@ -1594,6 +1595,12 @@
 							ast_channel_unlock(in);
 							sent_ring = 1;
 						}
+						if (!to_reset) {
+							*to_answer = orig_answer_to;
+							start = ast_tvnow();
+							to_reset = 1;
+							ast_verb(3, "Dial Tiemout Reset on channel %s due to RINGING message\n",ast_channel_name(c));
+						}
 					}
 					ast_channel_publish_dial(in, c, NULL, "RINGING");
 					break;
@@ -1655,6 +1662,12 @@
 							ast_log(LOG_WARNING, "Called channel %s hung up post-progress before all digits could be sent\n", ast_channel_name(c));
 							goto wait_over;
 						}
+						if (!to_reset) {
+							*to_answer = orig_answer_to;
+							start = ast_tvnow();
+							to_reset = 1;
+							ast_verb(3, "Dial Tiemout Reset on channel %s due to PROGRESS message.\n",ast_channel_name(c));
+						}
 					}
 					ast_channel_publish_dial(in, c, NULL, "PROGRESS");
 					break;
openSUSE Build Service is sponsored by