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

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

index 3af38e389aa9c505b819f3fbc6ab81f789a33867..4334f597ceb813113d1231d4caabad70bc6d8b29 100644 (file)
@@ -878,6 +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);
                }
                break;
        default:
@@ -947,6 +948,7 @@ static int on_dchan_up(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_ev
        if (!zap_test_flag(spri, LPWRAP_PRI_READY)) {
                zap_log(ZAP_LOG_INFO, "Span %d D-Chan UP!\n", spri->span->span_id);
                zap_set_flag(spri, LPWRAP_PRI_READY);
+               zap_set_state_all(spri->span, ZAP_CHANNEL_STATE_RESTART);
        }
 
        return 0;
@@ -965,6 +967,8 @@ static int on_dchan_down(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_
        if (zap_test_flag(spri, LPWRAP_PRI_READY)) {
                zap_log(ZAP_LOG_INFO, "Span %d D-Chan DOWN!\n", spri->span->span_id);
                zap_clear_flag(spri, LPWRAP_PRI_READY);
+               zap_set_state_all(spri->span, ZAP_CHANNEL_STATE_RESTART);
+               
        }
 
        return 0;
index 7a4de2ad93b155e59bc00f6bc1cd16822d13a2d9..085370b76ea31710b2b23aa0ed5ff081380613b2 100644 (file)
@@ -1055,10 +1055,11 @@ static ZIO_READ_FUNCTION(zt_read)
        zap_ssize_t r = 0;
        int errs = 0;
 
-       while (errs++ < 300) {
+       while (errs++ < 30) {
                if ((r = read(zchan->sockfd, data, *datalen)) > 0) {
                        break;
                }
+               zap_sleep(10);
                if (r == 0) {
                        errs--;
                }
@@ -1070,6 +1071,11 @@ 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;