From ae6976b74fbc8eb1e21efa048d734ca76168b4ba Mon Sep 17 00:00:00 2001 From: Super User Date: Wed, 19 Sep 2007 17:28:56 +0200 Subject: [PATCH] testing --- apppbx.cpp | 29 +++++++++++++++++++++++++++-- interface.c | 7 +++++++ mISDN.cpp | 30 +++++++++++++++++++++++++----- todo.txt | 1 + 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/apppbx.cpp b/apppbx.cpp index 1262ef6..b7a8357 100644 --- a/apppbx.cpp +++ b/apppbx.cpp @@ -866,14 +866,24 @@ foundif: } i++; } + trace_header("CHANNEL SELECTION (no channel is 'free')", DIRECTION_NONE); + add_trace("port", NULL, "%d", ifport->portnum); + add_trace("position", NULL, "%d", index); + end_trace(); break; case CHANNEL_ANY: /* don't ask for channel */ if (mISDNport->b_reserved >= mISDNport->b_num) { + trace_header("CHANNEL SELECTION (cannot ask for 'any' channel, all reserved)", DIRECTION_NONE); + add_trace("port", NULL, "%d", ifport->portnum); + add_trace("position", NULL, "%d", index); + add_trace("total", NULL, "%d", mISDNport->b_num); + add_trace("reserved", NULL, "%d", mISDNport->b_reserved); + end_trace(); break; /* all channel in use or reserverd */ } - trace_header("CHANNEL SELECTION (using 'any channel')", DIRECTION_NONE); + trace_header("CHANNEL SELECTION (using 'any' channel)", DIRECTION_NONE); add_trace("port", NULL, "%d", ifport->portnum); add_trace("position", NULL, "%d", index); end_trace(); @@ -881,7 +891,7 @@ foundif: break; case CHANNEL_NO: /* call waiting */ - trace_header("CHANNEL SELECTION (using 'no channel', call-waiting)", DIRECTION_NONE); + trace_header("CHANNEL SELECTION (using 'no' channel, call-waiting)", DIRECTION_NONE); add_trace("port", NULL, "%d", ifport->portnum); add_trace("position", NULL, "%d", index); end_trace(); @@ -890,10 +900,25 @@ foundif: default: if (selchannel->channel<1 || selchannel->channel==16) + { + trace_header("CHANNEL SELECTION (channel out of range)", DIRECTION_NONE); + add_trace("port", NULL, "%d", ifport->portnum); + add_trace("position", NULL, "%d", index); + add_trace("channel", NULL, "%d", selchannel->channel); + end_trace(); break; /* invalid channels */ + } i = selchannel->channel-1-(selchannel->channel>=17); if (i >= mISDNport->b_num) + { + trace_header("CHANNEL SELECTION (channel out of range)", DIRECTION_NONE); + add_trace("port", NULL, "%d", ifport->portnum); + add_trace("position", NULL, "%d", index); + add_trace("channel", NULL, "%d", selchannel->channel); + add_trace("channels", NULL, "%d", mISDNport->b_num); + end_trace(); break; /* channel not in port */ + } if (mISDNport->b_port[i] == NULL) { *channel = selchannel->channel; diff --git a/interface.c b/interface.c index 1c0956b..b27eeb2 100644 --- a/interface.c +++ b/interface.c @@ -743,6 +743,13 @@ struct interface_param interface_param[] = { "This parameter must follow a 'port' parameter."}, #if 0 + {"layer2keep", &inter_layer2keep, "yes | no", + "By default, layer 2 is establised and kept up on PTP interfaces.\n" + ".\n" + "This parameter must follow a 'port' parameter."}, +#endif + +#if 0 #warning todo: filter, also in the PmISDN object {"filter", &inter_filter, " [parameters]", "Adds/appends a filter. Filters are ordered in transmit direction.\n" diff --git a/mISDN.cpp b/mISDN.cpp index 4b4e3fc..bdc1780 100644 --- a/mISDN.cpp +++ b/mISDN.cpp @@ -1532,6 +1532,21 @@ void PmISDN::bchannel_receive(iframe_t *frm) message_put(message); break; + default: + chan_trace_header(p_m_mISDNport, this, "BCHANNEL control", DIRECTION_IN); + add_trace("unknown", NULL, "0x%x", cont); + end_trace(); + } + return; + } +#ifdef SOCKET_MISDN + if (hh->prim == PH_SIGNAL_IND) +#else + if (frm->prim == (PH_SIGNAL | INDICATION)) +#endif + { + switch(frm->dinfo) + { case CMX_TX_DATA: if (!p_m_txdata) { @@ -1539,13 +1554,18 @@ void PmISDN::bchannel_receive(iframe_t *frm) 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) + break; +// printf(".");fflush(stdout);return; if (p_record) - record((unsigned char *)(cont+1), len - 4, 1); // from up + record(data, len, 1); // from up break; default: - chan_trace_header(p_m_mISDNport, this, "BCHANNEL control", DIRECTION_IN); - add_trace("unknown", NULL, "0x%x", cont); + chan_trace_header(p_m_mISDNport, this, "BCHANNEL signal", DIRECTION_IN); + add_trace("unknown", NULL, "0x%x", frm->dinfo); end_trace(); } return; @@ -1561,14 +1581,13 @@ void PmISDN::bchannel_receive(iframe_t *frm) #endif return; } - /* calls will not process any audio data unless * the call is connected OR interface features audio during call setup. */ //printf("%d -> %d prim=%x joindata=%d tones=%d\n", p_serial, ACTIVE_EPOINT(p_epointlist), frm->prim, p_m_joindata, p_m_mISDNport->earlyb); #ifndef DEBUG_COREBRIDGE if (p_state!=PORT_STATE_CONNECT - && !p_m_mISDNport->earlyb) + && !p_m_mISDNport->tones) return; #endif @@ -2460,6 +2479,7 @@ int mISDN_handler(void) case PH_DATA | INDICATION: case DL_DATA | INDICATION: case PH_CONTROL | INDICATION: + case PH_SIGNAL | INDICATION: i = 0; while(i < mISDNport->b_num) { diff --git a/todo.txt b/todo.txt index dd142fc..fe404ae 100644 --- a/todo.txt +++ b/todo.txt @@ -1,3 +1,4 @@ +layer-2-hold interface feature neue params zum aufbau eines externen/internen calls neue params zun aufbau eines externen/internen calls dokumentieren -- 2.13.6