must send "proceeding" instead of "setup_acknowledge", in case the number
authorSuper User <root@isdn.jolly.ten>
Tue, 8 Jul 2008 19:46:35 +0000 (21:46 +0200)
committerSuper User <root@isdn.jolly.ten>
Tue, 8 Jul 2008 19:46:35 +0000 (21:46 +0200)
in the setup-message has "sending complete" element. otherwhise it is a
protocol error.

Christian: you must also consider it in chan_mISDN.

fixed channel hunting bug. (hope so)

modified:   README
modified:   dss1.cpp

README
dss1.cpp

diff --git a/README b/README
index 705df0b..d641370 100644 (file)
--- a/README
+++ b/README
@@ -433,4 +433,6 @@ Changes in Version 1.0
 Changes for next Version
 - Fixed dtmf bug.
 - Added more display infos
+- Fixed b-channel check bug. (channel seemed busy, even if it was free)
+- Forced proceeding, if "sending complete".
 
index 75f4a85..d4e90e6 100644 (file)
--- a/dss1.cpp
+++ b/dss1.cpp
@@ -326,13 +326,22 @@ int Pdss1::hunt_bchannel(int channel, int exclusive)
                /* exclusive channel requests must be in the list */
                if (exclusive)
                {
+                       /* no exclusive channel */
                        if (!channel)
                        {
                                add_trace("conclusion", NULL, "exclusively requested channel not in list");
                                end_trace();
                                return(-6); // channel unacceptable
                        }
-                       i = selchannel->channel-1-(selchannel->channel>=17);
+                       /* get index for channel */
+                       i = channel-1-(channel>=17);
+                       if (i < 0 || i >= p_m_mISDNport->b_num || channel == 16)
+                       {
+                               add_trace("conclusion", NULL, "exclusively requested channel outside interface range");
+                               end_trace();
+                               return(-6); // channel unacceptable
+                       }
+                       /* check if busy */
                        if (p_m_mISDNport->b_port[i] == NULL)
                                goto use_channel;
                        add_trace("conclusion", NULL, "exclusively requested channel is busy");
@@ -343,7 +352,12 @@ int Pdss1::hunt_bchannel(int channel, int exclusive)
                /* requested channels in list will be used */
                if (channel)
                {
-                       i = selchannel->channel-1-(selchannel->channel>=17);
+                       /* get index for channel */
+                       i = channel-1-(channel>=17);
+                       if (i < 0 || i >= p_m_mISDNport->b_num || channel == 16)
+                       {
+                               add_trace("info", NULL, "requested channel %d outside interface range", channel);
+                       } else /* if inside range (else) check if available */
                        if (p_m_mISDNport->b_port[i] == NULL)
                                goto use_channel;
                }
@@ -2262,6 +2276,14 @@ void Pdss1::message_overlap(unsigned int epoint_id, int message_id, union parame
 {
        l3_msg *l3m;
 
+       /* in case of sending complete, we proceed */
+       if (p_dialinginfo.sending_complete)
+       {
+               PDEBUG(DEBUG_ISDN, "sending proceeding instead of setup_acknowledge, because address is complete.\n");
+               message_proceeding(epoint_id, message_id, param);
+               return;
+       }
+
        /* sending setup_acknowledge */
        l3m = create_l3msg();
        l1l2l3_trace_header(p_m_mISDNport, this, L3_SETUP_ACKNOWLEDGE_REQ, DIRECTION_OUT);