diff options
author | mattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-07-27 19:36:55 +0000 |
---|---|---|
committer | mattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-07-27 19:36:55 +0000 |
commit | f85c3104b6ba263be89d89f3ba0fbcae5d1ad495 (patch) | |
tree | 866a67ca75511f90b6513f39d47924d7ac102709 | |
parent | 980d05ae728ead85bd6aa7ca26e25364664b4d7a (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.c | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -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 */ |