From 660653fc06a609905294f3cdfa7330b02ad0fb61 Mon Sep 17 00:00:00 2001 From: markster Date: Wed, 4 Sep 2002 19:55:34 +0000 Subject: Version 0.3.0 from FTP git-svn-id: http://svn.digium.com/svn/zaptel/trunk@102 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- fxstest.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'fxstest.c') diff --git a/fxstest.c b/fxstest.c index 9715a1f..13bb24a 100755 --- a/fxstest.c +++ b/fxstest.c @@ -6,8 +6,17 @@ #include #include #include "zaptel.h" +#include "tonezone.h" #include "wcfxs.h" +static int tones[] = { + ZT_TONE_DIALTONE, + ZT_TONE_BUSY, + ZT_TONE_RINGTONE, + ZT_TONE_CONGESTION, + ZT_TONE_DIALRECALL, +}; + int main(int argc, char *argv[]) { int fd; @@ -18,6 +27,7 @@ int main(int argc, char *argv[]) " where cmd is one of:\n" " stats - reports voltages\n" " regdump - dumps ProSLIC registers\n" + " tones - plays a series of tones\n" " ring - rings phone\n"); exit(1); } @@ -35,6 +45,15 @@ int main(int argc, char *argv[]) } else { fprintf(stderr, "Phone is ringing...\n"); } + } else if (!strcasecmp(argv[2], "tones")) { + int x = 0; + for (;;) { + res = tone_zone_play_tone(fd, tones[x]); + if (res) + fprintf(stderr, "Unable to play tone %d\n", tones[x]); + sleep(3); + x=(x+1) % (sizeof(tones) / sizeof(tones[0])); + } } else if (!strcasecmp(argv[2], "stats")) { struct wcfxs_stats stats; res = ioctl(fd, WCFXS_GET_STATS, &stats); -- cgit v1.2.3