summaryrefslogtreecommitdiff
path: root/fxotune.c
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-01-17 17:20:33 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-01-17 17:20:33 +0000
commit44c67fd3692d61cf24fcbc76045bccf096220c3c (patch)
tree6c8f55ab65fe1bd3679c4154c8f1dda9ec7e8b17 /fxotune.c
parentf014898414b69f42c56dde0c3757de0d9df84806 (diff)
Working out a few bugs. Should be usable now.
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@564 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'fxotune.c')
-rwxr-xr-xfxotune.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fxotune.c b/fxotune.c
index 434d2d6..29eaa3b 100755
--- a/fxotune.c
+++ b/fxotune.c
@@ -226,13 +226,15 @@ int main (int argc , char **argv)
}
if (!strcasecmp(argv[1], "-s")) {
+ FILE *fp = NULL;
+
+ fp = fopen(configfile, "r");
+
for (i = 0;res != EOF; i++) {
struct wctdm_echo_coefs mycoefs;
char completezappath[56] = "";
int myzap,myacim,mycoef1,mycoef2,mycoef3,mycoef4,mycoef5,mycoef6,mycoef7,mycoef8;
- FILE *fp = NULL;
- fp = fopen(configfile, "r");
res = fscanf(fp, "%d=%d,%d,%d,%d,%d,%d,%d,%d,%d",&myzap,&myacim,&mycoef1,
&mycoef2,&mycoef3,&mycoef4,&mycoef5,&mycoef6,&mycoef7,
@@ -274,8 +276,13 @@ int main (int argc , char **argv)
fprintf(stdout, "%s: %s\n", completezappath, strerror(errno));
return -1;
}
+
+ close(fd);
}
+
+ fclose(fp);
+ fprintf(stdout, "fxotune: successfully set echo coeffecients on FXO modules\n");
return 0;
}
@@ -288,7 +295,7 @@ int main (int argc , char **argv)
configfd = open(configfile, O_CREAT|O_TRUNC|O_WRONLY);
if (configfd < 0) {
- fprintf(stdout, "open: %s\n", strerror(errno));
+ fprintf(stderr, "open: %s\n", strerror(errno));
return -1;
}