freetdm: ftmod_wanpipe - implement tx and rx flush command

This commit is contained in:
Moises Silva 2010-12-08 06:22:46 -05:00
parent d25cb0282b
commit 32e28540db

View File

@ -756,6 +756,16 @@ static FIO_COMMAND_FUNCTION(wanpipe_command)
err = sangoma_flush_bufs(ftdmchan->sockfd, &tdm_api); err = sangoma_flush_bufs(ftdmchan->sockfd, &tdm_api);
} }
break; break;
case FTDM_COMMAND_FLUSH_RX_BUFFERS:
{
err = sangoma_flush_rx_bufs(ftdmchan->sockfd, &tdm_api);
}
case FTDM_COMMAND_FLUSH_TX_BUFFERS:
break;
{
err = sangoma_flush_tx_bufs(ftdmchan->sockfd, &tdm_api);
}
break;
case FTDM_COMMAND_FLUSH_IOSTATS: case FTDM_COMMAND_FLUSH_IOSTATS:
{ {
err = sangoma_flush_stats(ftdmchan->sockfd, &tdm_api); err = sangoma_flush_stats(ftdmchan->sockfd, &tdm_api);
@ -775,12 +785,13 @@ static FIO_COMMAND_FUNCTION(wanpipe_command)
} }
break; break;
default: default:
err = FTDM_NOTIMPL;
break; break;
}; };
if (err) { if (err) {
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "%s", strerror(errno)); snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "%s", strerror(errno));
return FTDM_FAIL; return err;
} }