testing
authorSuper User <root@isdn.jolly.ten>
Wed, 19 Sep 2007 15:28:56 +0000 (17:28 +0200)
committerSuper User <root@isdn.jolly.ten>
Wed, 19 Sep 2007 15:28:56 +0000 (17:28 +0200)
apppbx.cpp
interface.c
mISDN.cpp
todo.txt

index 1262ef6..b7a8357 100644 (file)
@@ -866,14 +866,24 @@ foundif:
                                }
                                i++;
                        }
                                }
                                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)
                        {
                        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 */
                        }
                                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();
                        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 */
                        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();
                        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)
 
                        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 */
                                break; /* invalid channels */
+                       }
                        i = selchannel->channel-1-(selchannel->channel>=17);
                        if (i >= mISDNport->b_num)
                        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 */
                                break; /* channel not in port */
+                       }
                        if (mISDNport->b_port[i] == NULL)
                        {
                                *channel = selchannel->channel;
                        if (mISDNport->b_port[i] == NULL)
                        {
                                *channel = selchannel->channel;
index 1c0956b..b27eeb2 100644 (file)
@@ -743,6 +743,13 @@ struct interface_param interface_param[] = {
        "This parameter must follow a 'port' parameter."},
 
 #if 0
        "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, "<filter> [parameters]",
        "Adds/appends a filter. Filters are ordered in transmit direction.\n"
 #warning todo: filter, also in the PmISDN object
        {"filter", &inter_filter, "<filter> [parameters]",
        "Adds/appends a filter. Filters are ordered in transmit direction.\n"
index 4b4e3fc..bdc1780 100644 (file)
--- a/mISDN.cpp
+++ b/mISDN.cpp
@@ -1532,6 +1532,21 @@ void PmISDN::bchannel_receive(iframe_t *frm)
                        message_put(message);
                        break;
 
                        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)
                        {
                        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;
                        }
                                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)
                        if (p_record)
-                               record((unsigned char *)(cont+1), len - 4, 1); // from up
+                               record(data, len, 1); // from up
                        break;
 
                        default:
                        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;
                        end_trace();
                }
                return;
@@ -1561,14 +1581,13 @@ void PmISDN::bchannel_receive(iframe_t *frm)
 #endif
                return;
        }
 #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
        /* 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
 
                return;
 #endif
 
@@ -2460,6 +2479,7 @@ int mISDN_handler(void)
                        case PH_DATA | INDICATION:
                        case DL_DATA | INDICATION:
                        case PH_CONTROL | INDICATION:
                        case PH_DATA | INDICATION:
                        case DL_DATA | INDICATION:
                        case PH_CONTROL | INDICATION:
+                       case PH_SIGNAL | INDICATION:
                        i = 0;
                        while(i < mISDNport->b_num)
                        {
                        i = 0;
                        while(i < mISDNport->b_num)
                        {
index dd142fc..fe404ae 100644 (file)
--- 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
 
 neue params zum aufbau eines externen/internen calls
 neue params zun aufbau eines externen/internen calls dokumentieren