diff mgw/main.c @ 170:a6eb2de277f6

mgw: massive simplification for continuous RTP stream from BTS
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 20 Nov 2022 01:58:47 -0800
parents f062c32a5116
children
line wrap: on
line diff
--- a/mgw/main.c	Sat Nov 19 23:08:49 2022 -0800
+++ b/mgw/main.c	Sun Nov 20 01:58:47 2022 -0800
@@ -14,13 +14,9 @@
 #include <syslog.h>
 #include <unistd.h>
 
-extern int dtmf_timer_running;
-extern struct timeval dtmf_next_time;
-
 fd_set select_for_read;
 void (*select_handlers[FD_SETSIZE])();
 void *select_data[FD_SETSIZE];
-struct timeval cur_event_time;
 
 static int max_fd;
 
@@ -39,7 +35,6 @@
 	char **argv;
 {
 	fd_set fds;
-	struct timeval timeout;
 	int cc, i;
 
 	openlog("themwi-mgw", 0, LOG_LOCAL5);
@@ -53,31 +48,19 @@
 	/* main select loop */
 	for (;;) {
 		bcopy(&select_for_read, &fds, sizeof(fd_set));
-		if (dtmf_timer_running) {
-			if (timercmp(&dtmf_next_time, &cur_event_time, >))
-				timersub(&dtmf_next_time, &cur_event_time,
-					 &timeout);
-			else
-				timerclear(&timeout);
-			cc = select(max_fd+1, &fds, 0, 0, &timeout);
-		} else
-			cc = select(max_fd+1, &fds, 0, 0, 0);
+		cc = select(max_fd+1, &fds, 0, 0, 0);
 		if (cc < 0) {
 			if (errno == EINTR)
 				continue;
 			syslog(LOG_CRIT, "select: %m");
 			exit(1);
 		}
-		gettimeofday(&cur_event_time, 0);
 		for (i = 0; cc && i <= max_fd; i++) {
 			if (FD_ISSET(i, &fds)) {
 				select_handlers[i](i, select_data[i]);
 				cc--;
 			}
 		}
-		if (dtmf_timer_running &&
-		    !timercmp(&cur_event_time, &dtmf_next_time, <))
-			dtmf_timer_process();
 		free_deleted_endpoints();
 	}
 }