diff options
Diffstat (limited to 'fxstest.c')
-rwxr-xr-x | fxstest.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -6,8 +6,17 @@ #include <unistd.h> #include <sys/ioctl.h> #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); |