mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-14 21:38:34 +00:00
Support for AT&T *8 Transfer (VRU only)
This commit is contained in:
1 parent
3fa2fce3f3
commit
bd7672242c
17 files changed
+845
-197
No files matched your search
@@ -1193,12 +1193,26 @@ FIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
|
||||
#else
|
||||
if (pfds[i-1].revents & POLLPRI) {
|
||||
#endif
|
||||
ftdm_set_flag(ftdmchan, FTDM_CHANNEL_EVENT);
|
||||
ftdm_set_io_flag(ftdmchan, FTDM_CHANNEL_IO_EVENT);
|
||||
ftdmchan->last_event_time = ftdm_current_time_in_ms();
|
||||
k++;
|
||||
}
|
||||
#ifdef LIBSANGOMA_VERSION
|
||||
if (outflags[i-1] & POLLIN) {
|
||||
#else
|
||||
if (pfds[i-1].revents & POLLIN) {
|
||||
#endif
|
||||
ftdm_set_io_flag(ftdmchan, FTDM_CHANNEL_IO_READ);
|
||||
}
|
||||
#ifdef LIBSANGOMA_VERSION
|
||||
if (outflags[i-1] & POLLOUT) {
|
||||
#else
|
||||
if (pfds[i-1].revents & POLLOUT) {
|
||||
#endif
|
||||
ftdm_set_io_flag(ftdmchan, FTDM_CHANNEL_IO_WRITE);
|
||||
}
|
||||
}
|
||||
/* when k is 0 it might be that an async wanpipe device signal was delivered */
|
||||
/* when k is 0 it might be that an async wanpipe device signal was delivered */
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1445,14 +1459,9 @@ FIO_CHANNEL_NEXT_EVENT_FUNCTION(wanpipe_channel_next_event)
|
||||
wanpipe_tdm_api_t tdm_api;
|
||||
ftdm_span_t *span = ftdmchan->span;
|
||||
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_EVENT)) {
|
||||
ftdm_clear_flag(ftdmchan, FTDM_CHANNEL_EVENT);
|
||||
}
|
||||
|
||||
memset(&tdm_api, 0, sizeof(tdm_api));
|
||||
status = sangoma_tdm_read_event(ftdmchan->sockfd, &tdm_api);
|
||||
if (status != FTDM_SUCCESS) {
|
||||
snprintf(span->last_error, sizeof(span->last_error), "%s", strerror(errno));
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Failed to read event from channel: %s\n", strerror(errno));
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
@@ -1488,7 +1497,7 @@ FIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_span_next_event)
|
||||
for(i = 1; i <= span->chan_count; i++) {
|
||||
/* as a hack for wink/flash detection, wanpipe_poll_event overrides the timeout parameter
|
||||
* to force the user to call this function each 5ms or so to detect the timeout of our wink/flash */
|
||||
if (span->channels[i]->last_event_time && !ftdm_test_flag(span->channels[i], FTDM_CHANNEL_EVENT)) {
|
||||
if (span->channels[i]->last_event_time && !ftdm_test_io_flag(span->channels[i], FTDM_CHANNEL_IO_EVENT)) {
|
||||
ftdm_time_t diff = ftdm_current_time_in_ms() - span->channels[i]->last_event_time;
|
||||
/* XX printf("%u %u %u\n", diff, (unsigned)ftdm_current_time_in_ms(), (unsigned)span->channels[i]->last_event_time); */
|
||||
if (ftdm_test_flag(span->channels[i], FTDM_CHANNEL_WINK)) {
|
||||
@@ -1520,13 +1529,13 @@ FIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_span_next_event)
|
||||
goto event;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ftdm_test_flag(span->channels[i], FTDM_CHANNEL_EVENT)) {
|
||||
}
|
||||
if (ftdm_test_io_flag(span->channels[i], FTDM_CHANNEL_IO_EVENT)) {
|
||||
ftdm_status_t status;
|
||||
wanpipe_tdm_api_t tdm_api;
|
||||
ftdm_channel_t *ftdmchan = span->channels[i];
|
||||
memset(&tdm_api, 0, sizeof(tdm_api));
|
||||
ftdm_clear_flag(span->channels[i], FTDM_CHANNEL_EVENT);
|
||||
ftdm_clear_io_flag(span->channels[i], FTDM_CHANNEL_IO_EVENT);
|
||||
|
||||
err = sangoma_tdm_read_event(ftdmchan->sockfd, &tdm_api);
|
||||
if (err != FTDM_SUCCESS) {
|
||||
|
||||
Reference in new issue
Block a user