diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2002-09-04 19:55:34 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2002-09-04 19:55:34 +0000 |
commit | 660653fc06a609905294f3cdfa7330b02ad0fb61 (patch) | |
tree | 9bb82cec50bccb78161fff1674813e7ccae295b2 /fxstest.c | |
parent | d02d74bf8ef6149dc5da847c7728b38a1d7c3569 (diff) |
Version 0.3.0 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@102 5390a7c7-147a-4af0-8ec9-7488f05a26cb
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); |