]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
merge
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 24 May 2007 13:39:40 +0000 (13:39 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 24 May 2007 13:39:40 +0000 (13:39 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@133 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/zap_analog.c
libs/freetdm/src/zap_wanpipe.c

index c9e93bdb83acc65d6498ff93a1ff3ee2ed179276..1021dbae2753f7c713a6c4d97e97cd1d70b8c255 100644 (file)
@@ -201,7 +201,6 @@ static void *zap_analog_run(zap_thread_t *me, void *obj)
                status = zap_span_poll_event(span, waitms);
                
                switch(status) {
-               case ZAP_TIMEOUT:
                case ZAP_SUCCESS:
                        {
                                zap_event_t *event;
index dbe48cd061b56c8b3620f1a0740415ee38ab6be3..448bc146cd28ca15ad77aa5d554fac3919c658aa 100644 (file)
@@ -416,20 +416,26 @@ static ZIO_WAIT_FUNCTION(wanpipe_wait)
 ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
 {
        struct pollfd pfds[ZAP_MAX_CHANNELS_SPAN];
-       int i, j = 0, k = 0, r;
+       int i, j = 0, k = 0, l = 0, r;
        
        for(i = 1; i <= span->chan_count; i++) {
                memset(&pfds[j], 0, sizeof(pfds[j]));
                pfds[j].fd = span->channels[i].sockfd;
                pfds[j].events = POLLPRI;
-               //printf("set %d=%d\n", j, pfds[j].fd);
+               if (zap_test_flag((&span->channels[i]), ZAP_CHANNEL_WINK) || zap_test_flag((&span->channels[i]), ZAP_CHANNEL_FLASH)) {
+                       l++;
+               }
                j++;
        }
 
+       if (l) {
+               ms = 5;
+       }
+       
     r = poll(pfds, j, ms);
        
        if (r == 0) {
-               return ZAP_TIMEOUT;
+               return l ? ZAP_SUCCESS : ZAP_TIMEOUT;
        } else if (r < 0) {
                snprintf(span->last_error, sizeof(span->last_error), "%s", strerror(errno));
                return ZAP_FAIL;