+void PmISDN::update_rxoff(void)
+{
+ int tx_dejitter = 0;
+
+ /* call bridges in user space OR crypto OR recording */
+ if (p_bridge || p_m_crypt_msg_loops || p_m_crypt_listen || p_record || p_m_inband_receive_on) {
+ /* rx IS required */
+ if (p_m_rxoff) {
+ /* turn on RX */
+ p_m_rxoff = 0;
+ PDEBUG(DEBUG_BCHANNEL, "%s: receive data is required, so we turn them on\n", __FUNCTION__);
+ if (p_m_b_index > -1)
+ if (p_m_mISDNport->b_port[p_m_b_index] && p_m_mISDNport->b_state[p_m_b_index] == B_STATE_ACTIVE)
+ ph_control(p_m_mISDNport, this, p_m_mISDNport->b_sock[p_m_b_index].fd, DSP_RECEIVE_ON, 0, "DSP-RXOFF", 0);
+ }
+ } else {
+ /* rx NOT required */
+ if (!p_m_rxoff) {
+ /* turn off RX */
+ p_m_rxoff = 1;
+ PDEBUG(DEBUG_BCHANNEL, "%s: receive data is not required, so we turn them off\n", __FUNCTION__);
+ if (p_m_b_index > -1)
+ if (p_m_mISDNport->b_port[p_m_b_index] && p_m_mISDNport->b_state[p_m_b_index] == B_STATE_ACTIVE)
+ ph_control(p_m_mISDNport, this, p_m_mISDNport->b_sock[p_m_b_index].fd, DSP_RECEIVE_OFF, 0, "DSP-RXOFF", 1);
+ }
+ }
+ /* recording */
+ if (p_record) {
+ /* txdata IS required */
+ if (!p_m_txdata) {
+ /* turn on RX */
+ p_m_txdata = 1;
+ PDEBUG(DEBUG_BCHANNEL, "%s: transmit data is required, so we turn them on\n", __FUNCTION__);
+ if (p_m_b_index > -1)
+ if (p_m_mISDNport->b_port[p_m_b_index] && p_m_mISDNport->b_state[p_m_b_index] == B_STATE_ACTIVE)
+ ph_control(p_m_mISDNport, this, p_m_mISDNport->b_sock[p_m_b_index].fd, DSP_TXDATA_ON, 0, "DSP-TXDATA", 1);
+ }
+ } else {
+ /* txdata NOT required */
+ if (p_m_txdata) {
+ /* turn off RX */
+ p_m_txdata = 0;
+ PDEBUG(DEBUG_BCHANNEL, "%s: transmit data is not required, so we turn them off\n", __FUNCTION__);
+ if (p_m_b_index > -1)
+ if (p_m_mISDNport->b_port[p_m_b_index] && p_m_mISDNport->b_state[p_m_b_index] == B_STATE_ACTIVE)
+ ph_control(p_m_mISDNport, this, p_m_mISDNport->b_sock[p_m_b_index].fd, DSP_TXDATA_OFF, 0, "DSP-TXDATA", 0);
+ }
+ }
+ /* dejitter on bridge */
+ if (p_bridge)
+ tx_dejitter = 1;
+ if (p_m_tx_dejitter != tx_dejitter) {
+ p_m_tx_dejitter = tx_dejitter;
+ PDEBUG(DEBUG_BCHANNEL, "we change dejitter mode to delay=%d.\n", p_m_tx_dejitter);
+ if (p_m_b_index > -1)
+ if (p_m_mISDNport->b_state[p_m_b_index] == B_STATE_ACTIVE && p_m_mISDNport->b_mode[p_m_b_index] == B_MODE_TRANSPARENT)
+ ph_control(p_m_mISDNport, this, p_m_mISDNport->b_sock[p_m_b_index].fd, DSP_TX_DEJITTER, p_m_tx_dejitter, "DSP-TX_DEJITTER", p_m_tx_dejitter);
+ }
+}