mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 09:12:25 +00:00
update
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@26 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
73ca7fc464
commit
60e7073544
@ -24,16 +24,22 @@ int main(int argc, char *argv[])
|
|||||||
printf("set interval failed\n");
|
printf("set interval failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for(x = 0; x < 25; x++) {
|
for(x = 0; x < 25; x++) {
|
||||||
unsigned char buf[160];
|
unsigned char buf[80];
|
||||||
zap_size_t len = sizeof(buf);
|
zap_size_t len = sizeof(buf);
|
||||||
|
zap_wait_flag_t flags = ZAP_READ;
|
||||||
|
|
||||||
|
zap_channel_wait(chan, &flags, 0);
|
||||||
|
if (flags & ZAP_READ) {
|
||||||
if (zap_channel_read(chan, buf, &len) == ZAP_SUCCESS) {
|
if (zap_channel_read(chan, buf, &len) == ZAP_SUCCESS) {
|
||||||
printf("READ: %d\n", len);
|
printf("READ: %d\n", len);
|
||||||
} else {
|
} else {
|
||||||
printf("FAIL! %d\n", len);
|
printf("READ FAIL! %d\n", len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
printf("wait fail\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,8 +326,6 @@ static ZINT_WAIT_FUNCTION(wanpipe_wait)
|
|||||||
int s;
|
int s;
|
||||||
struct timeval tv, *tvp = NULL;
|
struct timeval tv, *tvp = NULL;
|
||||||
|
|
||||||
ZINT_WAIT_MUZZLE;
|
|
||||||
|
|
||||||
if (to) {
|
if (to) {
|
||||||
memset(&tv, 0, sizeof(tv));
|
memset(&tv, 0, sizeof(tv));
|
||||||
tv.tv_sec = to / 1000;
|
tv.tv_sec = to / 1000;
|
||||||
@ -411,6 +409,7 @@ static ZINT_READ_FUNCTION(wanpipe_read_unix)
|
|||||||
*datalen = rx_len;
|
*datalen = rx_len;
|
||||||
|
|
||||||
if (rx_len <= 0) {
|
if (rx_len <= 0) {
|
||||||
|
perror("wtf");
|
||||||
return ZAP_FAIL;
|
return ZAP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,7 +432,7 @@ static ZINT_WRITE_FUNCTION(wanpipe_write_unix)
|
|||||||
int bsent;
|
int bsent;
|
||||||
struct msghdr msg;
|
struct msghdr msg;
|
||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
wp_tdm_api_rx_hdr_t hdrframe;
|
wp_tdm_api_tx_hdr_t hdrframe;
|
||||||
|
|
||||||
memset(&msg, 0, sizeof(msg));
|
memset(&msg, 0, sizeof(msg));
|
||||||
memset(&hdrframe, 0, sizeof(hdrframe));
|
memset(&hdrframe, 0, sizeof(hdrframe));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user