Fixed missing channel IE in some cases.
authorAndreas Eversberg <jolly@eversberg.eu>
Sat, 3 Sep 2011 13:54:37 +0000 (15:54 +0200)
committerAndreas Eversberg <jolly@eversberg.eu>
Sat, 3 Sep 2011 13:54:37 +0000 (15:54 +0200)
NT-Mode: channel IE must be included in all cases
TE-Mode: channel IE can be omitted only if any channel is requested.

dss1.cpp
ie.cpp

index c819835..1dd009e 100644 (file)
--- a/dss1.cpp
+++ b/dss1.cpp
@@ -2036,7 +2036,7 @@ void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
        l3m = create_l3msg();
        l1l2l3_trace_header(p_m_mISDNport, this, L3_SETUP_REQ, DIRECTION_OUT);
        /* channel information */
-       if (channel >= 0) /* it should */
+       if (p_m_d_ntmode || channel != CHANNEL_ANY) /* only omit channel id in te-mode/any channel */
                enc_ie_channel_id(l3m, exclusive, channel);
        /* caller information */
        plan = 1;
diff --git a/ie.cpp b/ie.cpp
index ddb6c1b..e64a694 100644 (file)
--- a/ie.cpp
+++ b/ie.cpp
@@ -711,13 +711,15 @@ void Pdss1::enc_ie_channel_id(struct l3_msg *l3m, int exclusive, int channel)
                add_layer3_ie(l3m, p[0], p[1], p+2);
        } else {
                /* PRI */
-               if (channel == CHANNEL_NO) /* no channel */
-                       return; /* IE not present */
-               if (channel == CHANNEL_ANY) /* any channel */ {
+               if (channel == CHANNEL_NO || channel == CHANNEL_ANY) {
+                       if (channel == CHANNEL_NO)
+                               channel = 0;
+                       else
+                               channel = 3;
                        l = 1;
                        p[0] = IE_CHANNEL_ID;
                        p[1] = l;
-                       p[2] = 0x80 + 0x20 + 0x03;
+                       p[2] = 0x80 + 0x20 + channel;
                        add_layer3_ie(l3m, p[0], p[1], p+2);
                        return; /* end */
                }