]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: add debugging msgs for zt wait errors
authorMoises Silva <moy@sangoma.com>
Sat, 6 Nov 2010 21:14:31 +0000 (17:14 -0400)
committerMoises Silva <moy@sangoma.com>
Sat, 6 Nov 2010 21:14:31 +0000 (17:14 -0400)
libs/freetdm/mod_freetdm/mod_freetdm.c
libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c

index 3ad4393ab53379916e359a08ac96f47e9b5c988d..48bff28b0ac7f187c823ab9c16b267ccf2c77b7a 100755 (executable)
@@ -657,7 +657,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
        status = ftdm_channel_wait(tech_pvt->ftdmchan, &wflags, chunk);
        
        if (status == FTDM_FAIL) {
-               ftdm_log(FTDM_LOG_WARNING, "failed to wait for I/O\n");
+               ftdm_log(FTDM_LOG_ERROR, "Failed to wait for I/O\n");
                goto fail;
        }
        
index ae9398418afe91ea4bdd29fc02d3e4cdb8ecfc8c..692b505716aa84e3b1f738a8c01274ee29818341 100644 (file)
@@ -867,7 +867,7 @@ static FIO_WAIT_FUNCTION(zt_wait)
 {
        int32_t inflags = 0;
        int result;
-    struct pollfd pfds[1];
+       struct pollfd pfds[1];
 
        if (*flags & FTDM_READ) {
                inflags |= POLLIN;
@@ -882,13 +882,14 @@ static FIO_WAIT_FUNCTION(zt_wait)
        }
 
 
-    memset(&pfds[0], 0, sizeof(pfds[0]));
-    pfds[0].fd = ftdmchan->sockfd;
-    pfds[0].events = inflags;
-    result = poll(pfds, 1, to);
+       memset(&pfds[0], 0, sizeof(pfds[0]));
+       pfds[0].fd = ftdmchan->sockfd;
+       pfds[0].events = inflags;
+       result = poll(pfds, 1, to);
        *flags = 0;
 
        if (pfds[0].revents & POLLERR) {
+               ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "DAHDI device got POLLERR\n");
                result = -1;
        }
 
@@ -900,6 +901,7 @@ static FIO_WAIT_FUNCTION(zt_wait)
 
        if (result < 0){
                snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "Poll failed");
+               ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Failed to poll DAHDI device: %s\n", strerror(errno));
                return FTDM_FAIL;
        }