summaryrefslogtreecommitdiff
path: root/mgetty/mgetty-1.1.30/41-ugly-redo-ring.c_bug128668
blob: fa07ee1b8efda0417de5e180c78060e7c0c9b0a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- mgetty-1.1.30.orig/ring.c	Thu Dec  5 21:29:10 2002
+++ mgetty-1.1.30/ring.c	Mon Sep 29 20:30:23 2003
@@ -219,6 +219,8 @@
 char	buf[BUFSIZE], ch, *p;
 int	i, w, r;
 int	rc = SUCCESS;
+boolean got_name = FALSE;
+boolean got_nmbr = FALSE;
 boolean	got_dle;		/* for <DLE><char> events (voice mode) */
 
     lprintf( L_MESG, "wfr: waiting for ``RING''" );
@@ -321,7 +324,14 @@
 	 * instead of waiting for the next "real" RING
 	 * (but don't do this for V253 DRON/DROF modems!)
 	 */
-	if ( strncmp( buf, "NMBR", 4 ) == 0 && drox_count == 0 ) { break; }
+	if ( strncmp( buf, "NMBR", 4 ) == 0 && drox_count == 0 ) { got_nmbr = TRUE; }
+ 	if ( strncmp( buf, "NAME", 4 ) == 0 ) { got_name = TRUE; }
+
+ 	if ( got_nmbr && got_name ) break;	/* got both name & number */
+
+ 	/* special case -> break; do not expect caller name */
+ 	if ( got_nmbr && CallerId[0] == 'P' ) break; /* private */
+ 	if ( got_nmbr && CallerId[0] == 'O' ) break; /* out of area */
 
 	/* V.253 ring cadences */
 	if ( strncmp( buf, "DRON", 4 ) == 0 ||