freetdm: ftmod_zt - clear FTDM_CHANNEL_EVENT flag on zt_channel_next_event when set,

but retrieve event from channel even when it's not
This commit is contained in:
Arnaldo Pereira 2010-12-21 22:13:16 -02:00
parent 723a598c24
commit a3ea8a8f20
1 changed files with 83 additions and 84 deletions

View File

@ -1006,6 +1006,8 @@ FIO_CHANNEL_NEXT_EVENT_FUNCTION(zt_channel_next_event)
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_EVENT)) {
ftdm_clear_flag(ftdmchan, FTDM_CHANNEL_EVENT);
}
if (ioctl(ftdmchan->sockfd, codes.GETEVENT, &zt_event_id) == -1) {
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Failed retrieving event from channel: %s\n",
strerror(errno));
@ -1091,9 +1093,6 @@ FIO_CHANNEL_NEXT_EVENT_FUNCTION(zt_channel_next_event)
return FTDM_SUCCESS;
}
return FTDM_FAIL;
}
/**
* \brief Retrieves an event from a ftdmtel span
* \param span Span to retrieve event from