]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 27 Jul 2009 23:48:52 +0000 (23:48 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 27 Jul 2009 23:48:52 +0000 (23:48 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@785 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/ozmod/ozmod_libpri/lpwrap_pri.c
libs/freetdm/src/ozmod/ozmod_libpri/lpwrap_pri.h
libs/freetdm/src/ozmod/ozmod_libpri/ozmod_libpri.c
libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.c

index 762a939a02817ca87cf543147e47072d71a6e658..1c1a31d2c370a2828763541b30992406b6f096eb 100644 (file)
@@ -120,9 +120,11 @@ static int __pri_lpwrap_read(struct pri *pri, void *buf, int buflen)
        if ((zst = zap_channel_read(spri->dchan, buf, &len)) != ZAP_SUCCESS) {
                if (zst == ZAP_FAIL) {
                        zap_log(ZAP_LOG_CRIT, "span %d D-READ FAIL! [%s]\n", spri->span->span_id, spri->dchan->last_error);
+                       spri->errs++;
                } else {
                        zap_log(ZAP_LOG_CRIT, "span %d D-READ TIMEOUT\n", spri->span->span_id);
                }
+               
                zap_clear_flag(spri, LPWRAP_PRI_READY);
                return -1;
        }
@@ -203,9 +205,10 @@ int lpwrap_one_loop(struct lpwrap_pri *spri)
                }
        }
 
-       //if (!zap_test_flag(spri, LPWRAP_PRI_READY)) {
-       //return -1;
-       //}
+       if (spri->errs >= 2) {
+               spri->errs = 0;
+               return -1;
+       }
 
        FD_ZERO(&rfds);
        FD_ZERO(&efds);
index cae88ccb9295ed2d69f51fe69119e9be071eda37..4c79526b9e2656adbc83d41b35f03eb85b11b6ed 100644 (file)
@@ -103,6 +103,7 @@ struct lpwrap_pri {
        void *private_info;
        event_handler eventmap[LPWRAP_PRI_EVENT_MAX];
        loop_handler on_loop;
+       int errs;
 };
 
 typedef struct lpwrap_pri lpwrap_pri_t;
index 4334f597ceb813113d1231d4caabad70bc6d8b29..195af19ed90d88c9d4b0337895dc991c713f7928 100644 (file)
@@ -878,7 +878,7 @@ static __inline__ void check_events(zap_span_t *span)
        case ZAP_FAIL:
                {
                        zap_log(ZAP_LOG_DEBUG, "Event Failure! %d\n", zap_running());
-                       zap_sleep(5000);
+                       zap_sleep(2000);
                }
                break;
        default:
index 085370b76ea31710b2b23aa0ed5ff081380613b2..a8ce338a63dad96415a271afbb807e4d92fb26db 100644 (file)
@@ -1071,11 +1071,6 @@ static ZIO_READ_FUNCTION(zt_read)
                        *datalen -= 2;
                }
                return ZAP_SUCCESS;
-       } else {
-               if (zchan->type == ZAP_CHAN_TYPE_DQ921) {
-                       unsigned char buf[25] = {0};
-                       write(zchan->sockfd, buf, sizeof(buf));
-               }
        }
 
        return r == 0 ? ZAP_TIMEOUT : ZAP_FAIL;