summaryrefslogtreecommitdiffstats
path: root/dss1.cpp
diff options
context:
space:
mode:
authorSuper User2008-07-08 21:46:35 +0200
committerSuper User2008-07-08 21:46:35 +0200
commit35c7fb918b2611bcae1f0df77040437b4097bcab (patch)
tree0b6b310f131233f8c555345583f79a6a93d425fb /dss1.cpp
parentadded more display info (diff)
downloadlcr-35c7fb918b2611bcae1f0df77040437b4097bcab.tar.gz
lcr-35c7fb918b2611bcae1f0df77040437b4097bcab.tar.xz
lcr-35c7fb918b2611bcae1f0df77040437b4097bcab.zip
must send "proceeding" instead of "setup_acknowledge", in case the number
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
Diffstat (limited to 'dss1.cpp')
-rw-r--r--dss1.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/dss1.cpp b/dss1.cpp
index 75f4a85..d4e90e6 100644
--- 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);