alpine 3.9
obsolete weakness #534

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

dahdi-tools/src/dahdi-tools-2.11.1/fxstest.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.9 obsolete weakness.

 		
		if(argc >= 4) {	/* Use user supplied string */
			outstring = argv[3];
		}
		printf("Going to send a set of DTMF tones >%s<\n", outstring);
		/* Flush any left remaining characs in the buffer and place the channel into on-hook transfer mode */
		x = DAHDI_FLUSH_BOTH;
		res = ioctl(fd, DAHDI_FLUSH, &x);
		x = 500 + strlen(outstring) * 100;
		ioctl(fd, DAHDI_ONHOOKTRANSFER, &x);

		/* Play the DTMF tones at a 50 mS on and 50 mS off rate which is standard for DTMF CID spills */
		for (x = 0; '\0' != outstring[x]; x++) {

			dtmftone = digit_to_dtmfindex(outstring[x]);
			if (0 > dtmftone) {
				dtmftone = -1;
			}
			res = tone_zone_play_tone(fd, dtmftone);
			if (res) {
				fprintf(stderr, "Unable to play DTMF tone %d (0x%x)\n", dtmftone, dtmftone);
			}
			usleep(50000);
			tone_zone_play_tone(fd, -1);
			usleep(50000);
		}
		/* Wait for 150 mS from end of last tone to initiating the ring */
		usleep(100000);
		dahdi_ring_phone(fd);
		sleep(10);
		printf("Ringing Done\n");
	} else
		fprintf(stderr, "Invalid command\n");
	close(fd);
	return 0;
} 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.