}
/* send data */
- if (p_m_mISDNport->b_state[p_m_b_index] == B_STATE_ACTIVE)
+ if (p_m_mISDNport->b_state[p_m_b_index] == B_STATE_ACTIVE && ISDN_LOAD-p_m_load-tosend > 0)
{
#ifdef SOCKET_MISDN
frm->prim = PH_DATA_REQ;
frm->id = 0;
ret = sendto(p_m_mISDNport->b_socket[p_m_b_index], buf, MISDN_HEADER_LEN+ISDN_LOAD-p_m_load-tosend, 0, NULL, 0);
if (ret <= 0)
- PERROR("Failed to send to socket %d\n", p_m_mISDNport->b_socket[p_m_b_index]);
+ PERROR("Failed to send to socket %d (samples = %d)\n", p_m_mISDNport->b_socket[p_m_b_index], ISDN_LOAD-p_m_load-tosend);
#else
frm->prim = DL_DATA | REQUEST;
frm->addr = p_m_mISDNport->b_addr[p_m_b_index] | FLG_MSG_DOWN;
#endif
{
#ifndef OLD_MISDN
-#ifdef SOCKET_MISDN
- case DSP_TX_DATA:
-#else
+#ifndef SOCKET_MISDN
case CMX_TX_DATA:
-#endif
if (!p_m_txdata)
{
/* if tx is off, it may happen that fifos send us pending informations, we just ignore them */
record(data, len, 1); // from up
break;
#endif
+#endif
default:
chan_trace_header(p_m_mISDNport, this, "BCHANNEL control", DIRECTION_IN);
return;
}
#ifdef SOCKET_MISDN
+ if (hh->prim == PH_DATA_REQ || hh->prim == DL_DATA_REQ)
+ {
+ if (!p_m_txdata)
+ {
+ /* if tx is off, it may happen that fifos send us pending informations, we just ignore them */
+ PDEBUG(DEBUG_BCHANNEL, "PmISDN(%s) ignoring tx data, because 'txdata' is turned off\n", p_name);
+ return;
+ }
+ /* see below (same condition) */
+ if (p_state!=PORT_STATE_CONNECT
+ && !p_m_mISDNport->tones)
+ return;
+// printf(".");fflush(stdout);return;
+ if (p_record)
+ record(data, len, 1); // from up
+ return;
+ }
if (hh->prim != PH_DATA_IND && hh->prim != DL_DATA_IND)
{
PERROR("Bchannel received unknown primitve: 0x%x\n", hh->prim);
case MT_L2ESTABLISH:
l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_IND, DIRECTION_IN);
+ add_trace("tei", NULL, "%d", l3m->pid);
end_trace();
if ((!mISDNport->ntmode || mISDNport->ptp) && l3m->pid < 127)
{
case MT_L2RELEASE:
l1l2l3_trace_header(mISDNport, NULL, L2_RELEASE_IND, DIRECTION_IN);
+ add_trace("tei", NULL, "%d", l3m->pid);
end_trace();
if ((!mISDNport->ntmode || mISDNport->ptp) && l3m->pid < 127)
{
PDEBUG(DEBUG_ISDN, "the L2 establish timer expired, we try to establish the link portnum=%d.\n", mISDNport->portnum);
mISDNport->ml3->to_layer3(mISDNport->ml3, MT_L2ESTABLISH, 0, NULL);
l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_REQ, DIRECTION_OUT);
+ add_trace("tei", NULL, "%d", 0);
end_trace();
time(&mISDNport->l2establish);
return(1);
mISDN_write(mISDNdevice, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
}
l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_REQ, DIRECTION_OUT);
+ add_trace("tei", NULL, "%d", 0);
end_trace();
time(&mISDNport->l2establish);
return(1);
{
mISDNport->ml3->to_layer3(mISDNport->ml3, MT_L2ESTABLISH, 0, NULL);
l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_REQ, DIRECTION_OUT);
+ add_trace("tei", NULL, "%d", 0);
end_trace();
time(&mISDNport->l2establish);
}