summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-07-27 19:36:55 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-07-27 19:36:55 +0000
commitf85c3104b6ba263be89d89f3ba0fbcae5d1ad495 (patch)
tree866a67ca75511f90b6513f39d47924d7ac102709
parent980d05ae728ead85bd6aa7ca26e25364664b4d7a (diff)
Merged revisions 2787 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.4 ........ r2787 | mattf | 2007-07-27 14:36:06 -0500 (Fri, 27 Jul 2007) | 1 line Quick fix for the could not fill input buffer problem ........ git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2788 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--fxotune.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/fxotune.c b/fxotune.c
index 08c4454..9e12f3a 100644
--- a/fxotune.c
+++ b/fxotune.c
@@ -332,11 +332,14 @@ static int maptone(int whichzap, int freq, char *dialstr, int delayuntilsilence)
return -1;
}
- /* read return response */
+retry:
+ /* read return response */
res = read(whichzap, inbuf, BUFFER_LENGTH);
if (res != BUFFER_LENGTH) {
- fprintf(stderr, "Could not fill input buffer\n");
- return -1;
+ int x;
+
+ ioctl(whichzap, ZT_GETEVENT, &x);
+ goto retry;
}
/* write content of output buffer to debug file */
@@ -484,11 +487,14 @@ static int acim_tune2(int whichzap, int freq, char *dialstr, int delayuntilsilen
return -1;
}
+retry:
/* read return response */
res = read(whichzap, inbuf, BUFFER_LENGTH);
if (res != BUFFER_LENGTH) {
- fprintf(stderr, "Could not fill input buffer - got %d bytes, expected %d bytes\n", res, BUFFER_LENGTH);
- return -1;
+ int x;
+
+ ioctl(whichzap, ZT_GETEVENT, &x);
+ goto retry;
}
/* calculate RMS of response */
@@ -626,10 +632,14 @@ static int acim_tune(int whichzap, char *dialstr, int delayuntilsilence, int sil
}
/* read return response */
+retry:
+ /* read return response */
res = read(whichzap, inbuf, BUFFER_LENGTH);
if (res != BUFFER_LENGTH) {
- fprintf(stderr, "Could not fill input buffer\n");
- return -1;
+ int x;
+
+ ioctl(whichzap, ZT_GETEVENT, &x);
+ goto retry;
}
/* calculate power of response */