commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10067 - in openbts/branches/developers/dburgess00/ver


From: dburgess00
Subject: [Commit-gnuradio] r10067 - in openbts/branches/developers/dburgess00/veryearly: Control GSM SIP
Date: Tue, 25 Nov 2008 20:08:48 -0700 (MST)

Author: dburgess00
Date: 2008-11-25 20:08:44 -0700 (Tue, 25 Nov 2008)
New Revision: 10067

Modified:
   openbts/branches/developers/dburgess00/veryearly/Control/ControlCommon.h
   openbts/branches/developers/dburgess00/veryearly/Control/PagerTest.cpp
   openbts/branches/developers/dburgess00/veryearly/Control/RadioResource.cpp
   openbts/branches/developers/dburgess00/veryearly/GSM/GSMCommon.cpp
   openbts/branches/developers/dburgess00/veryearly/GSM/GSMCommon.h
   openbts/branches/developers/dburgess00/veryearly/GSM/GSML3RRMessages.cpp
   openbts/branches/developers/dburgess00/veryearly/GSM/GSML3RRMessages.h
   openbts/branches/developers/dburgess00/veryearly/SIP/SIPInterface.cpp
Log:
Support "channel needed" fields in the paging mechanism.


Modified: 
openbts/branches/developers/dburgess00/veryearly/Control/ControlCommon.h
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/Control/ControlCommon.h    
2008-11-26 02:10:50 UTC (rev 10066)
+++ openbts/branches/developers/dburgess00/veryearly/Control/ControlCommon.h    
2008-11-26 03:08:44 UTC (rev 10067)
@@ -199,6 +199,7 @@
        private:
 
        // FIXME -- We need to support channel type.  See tracker item #316.
+       GSM::ChannelType mType;                 ///< The needed channel type.
        GSM::L3MobileIdentity mID;              ///< The mobile ID.
        Timeval mExpiration;                    ///< The expiration time for 
this entry.
 
@@ -209,13 +210,16 @@
                @param wID The ID to be paged.
                @param wLife The number of milliseconds to keep paging.
        */
-       PagingEntry(const GSM::L3MobileIdentity& wID, unsigned wLife)
-               :mID(wID),mExpiration(wLife)
+       PagingEntry(const GSM::L3MobileIdentity& wID, GSM::ChannelType wType, 
unsigned wLife)
+               :mID(wID),mType(wType),mExpiration(wLife)
        {}
 
        /** Access the ID. */
        const GSM::L3MobileIdentity& ID() const { return mID; }
 
+       /** Access the channel type needed. */
+       const GSM::ChannelType type() const { return mType; }
+
        /** Renew the timer. */
        void renew(unsigned wLife) { mExpiration = Timeval(wLife); }
 
@@ -252,9 +256,10 @@
        /**
                Add a mobile ID to the paging list.
                @param addID The mobile ID to be paged.
+               @param chanType The channel type to be requested.
                @param wLife The paging duration in ms, default based on SIP 
INVITE retry preiod.
        */
-       void addID(const GSM::L3MobileIdentity& addID, unsigned wLife=4000);
+       void addID(const GSM::L3MobileIdentity& addID, GSM::ChannelType 
chanType, unsigned wLife=4000);
 
        private:
 

Modified: openbts/branches/developers/dburgess00/veryearly/Control/PagerTest.cpp
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/Control/PagerTest.cpp      
2008-11-26 02:10:50 UTC (rev 10066)
+++ openbts/branches/developers/dburgess00/veryearly/Control/PagerTest.cpp      
2008-11-26 03:08:44 UTC (rev 10067)
@@ -59,9 +59,9 @@
        pager.start();
 
        while (1) {
-               pager.addID(L3MobileIdentity(random()));
-               pager.addID(L3MobileIdentity(random()));
-               pager.addID(L3MobileIdentity("123456789012345"));
+               pager.addID(L3MobileIdentity(random()),GSM::AnyDCCHType);
+               pager.addID(L3MobileIdentity(random()),GSM::AnyDCCHType);
+               
pager.addID(L3MobileIdentity("123456789012345"),GSM::AnyDCCHType);
                sleep(random() % 2);
        }
 }

Modified: 
openbts/branches/developers/dburgess00/veryearly/Control/RadioResource.cpp
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/Control/RadioResource.cpp  
2008-11-26 02:10:50 UTC (rev 10066)
+++ openbts/branches/developers/dburgess00/veryearly/Control/RadioResource.cpp  
2008-11-26 03:08:44 UTC (rev 10067)
@@ -161,7 +161,7 @@
 
 
 
-void Pager::addID(const L3MobileIdentity& newID, unsigned wLife)
+void Pager::addID(const L3MobileIdentity& newID, ChannelType chanType, 
unsigned wLife)
 {
        // Add a mobile ID to the paging list for a given lifetime.
 
@@ -180,7 +180,7 @@
        }
        // If this ID is new, put it in the list.
        if (!renewed) {
-               mPageIDs.push_back(PagingEntry(newID,wLife));
+               mPageIDs.push_back(PagingEntry(newID,chanType,wLife));
                CLDCOUT("Pager::addID " << newID << " added to table");
        }
        // Signal in case the paging loop is waiting for new entries.
@@ -212,20 +212,24 @@
        while (lp != mPageIDs.end()) {
                // HACK -- Just pick the minimum load channel.
                // FIXME -- This completely ignores the paging goups, GSM 04.08 
10.5.2.11 and GSM 05.02 6.5.2.
-               GSM::CCCHLogicalChannel *PCH = gBTS.getPCH();
+               CCCHLogicalChannel *PCH = gBTS.getPCH();
                assert(PCH);
-               const L3MobileIdentity& id1 = lp->ID(); ++lp;
+               const L3MobileIdentity& id1 = lp->ID();
+               ChannelType type1 = lp->type();
+               ++lp;
                if (lp==mPageIDs.end()) {
                        // Just one ID left?
                        //CLDCOUT("Pager::pageAll paging " << id1);
-                       PCH->send(L3PagingRequestType1(id1));
+                       PCH->send(L3PagingRequestType1(id1,type1));
                        numPaged++;
                        break;
                }
                // Page by pairs when possible.
-               const L3MobileIdentity& id2 = lp->ID(); ++lp;
+               const L3MobileIdentity& id2 = lp->ID();
+               ChannelType type2 = lp->type();
+               ++lp;
                //CLDCOUT("Pager::pageAll paging " << id1 << " and " << id2);
-               PCH->send(L3PagingRequestType1(id1,id2));
+               PCH->send(L3PagingRequestType1(id1,type1,id2,type2));
                numPaged += 2;
        }
        

Modified: openbts/branches/developers/dburgess00/veryearly/GSM/GSMCommon.cpp
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/GSM/GSMCommon.cpp  
2008-11-26 02:10:50 UTC (rev 10066)
+++ openbts/branches/developers/dburgess00/veryearly/GSM/GSMCommon.cpp  
2008-11-26 03:08:44 UTC (rev 10067)
@@ -274,8 +274,10 @@
                case SACCHType: os << "SACCH"; break;
                case TCHFType: os << "TCH/F"; break;
                case TCHHType: os << "TCH/H"; break;
-               case LoopbackFullType: os << "LoopbackFull"; break;
-               case LoopbackHalfType: os << "LoopbackHalf"; break;
+               case AnyTCHType: os << "any TCH"; break;
+               case LoopbackFullType: os << "Loopback Full"; break;
+               case LoopbackHalfType: os << "Loopback Half"; break;
+               case AnyDCCHType: os << "any DCCH"; break;
                default: os << "?" << (int)val << "?";
        }
        return os;

Modified: openbts/branches/developers/dburgess00/veryearly/GSM/GSMCommon.h
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/GSM/GSMCommon.h    
2008-11-26 02:10:50 UTC (rev 10066)
+++ openbts/branches/developers/dburgess00/veryearly/GSM/GSMCommon.h    
2008-11-26 03:08:44 UTC (rev 10067)
@@ -185,12 +185,14 @@
        //@{
        TCHFType,               ///< full-rate traffic
        TCHHType,               ///< half-rate traffic
+       AnyTCHType,             ///< any TCH type
        //@}
        ///@name Special internal channel types.
        //@{
        LoopbackFullType,               ///< loopback testing
        LoopbackHalfType,               ///< loopback testing
-       UndefinedCHType,        ///< undefined
+       AnyDCCHType,                    ///< any dedicated control channel
+       UndefinedCHType,                ///< undefined
        //@}
 };
 

Modified: 
openbts/branches/developers/dburgess00/veryearly/GSM/GSML3RRMessages.cpp
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/GSM/GSML3RRMessages.cpp    
2008-11-26 02:10:50 UTC (rev 10066)
+++ openbts/branches/developers/dburgess00/veryearly/GSM/GSML3RRMessages.cpp    
2008-11-26 03:08:44 UTC (rev 10067)
@@ -143,6 +143,23 @@
 
 
 
+/**
+This is a local function to map the GSM::ChannelType enum
+to one of the codes from GMS 04.07 10.5.2.8.
+*/
+unsigned channelNeededCode(ChannelType wType)
+{
+       switch (wType) {
+               case AnyDCCHType: return 0;
+               case SDCCHType: return 1;
+               case TCHFType: return 2;
+               case AnyTCHType: return 3;
+               default: abort();
+       }
+}
+
+
+
 size_t L3PagingRequestType1::bodyLength() const
 {
        int sz = mMobileIDs.size();
@@ -154,14 +171,25 @@
 }
 
 
+
 void L3PagingRequestType1::writeBody(L3Frame& dest, size_t &wp) const
 {
+       // See GSM 04.08 9.1.22.
+       // Page Mode Page Mode M V 1/2 10.5.2.26    
+       // Channels Needed  M V 1/2 
+       // Mobile Identity 1 M LV 2-9 10.5.1.4    
+       // 0x17 Mobile Identity 2 O TLV  3-10 10.5.1.4    
+
        int sz = mMobileIDs.size();
        assert(sz<=2);
-       // Remember for reverse orders of 1/2-octet fields.
+       // Remember to reverse orders of 1/2-octet fields.
        // Because GSM transmits LSB-first within each byte.
-       dest.writeField(wp,0x0,4);              // "any channel", GSM 04.08 
Table 10.5.29
-       dest.writeField(wp,0x0,4);              // "normal paging", GSM 04.08 
Table 10.5.63
+       // channel needed codes
+       dest.writeField(wp,channelNeededCode(mChannelsNeeded[1]),2);
+       dest.writeField(wp,channelNeededCode(mChannelsNeeded[0]),2);
+       // "normal paging", GSM 04.08 Table 10.5.63
+       dest.writeField(wp,0x0,4);
+       // the actual mobile IDs
        mMobileIDs[0].writeLV(dest,wp);
        if (sz>1) mMobileIDs[1].writeTLV(0x17,dest,wp);
 }
@@ -172,7 +200,7 @@
        L3RRMessage::text(os);
        os << " mobileIDs=(";
        for (unsigned i=0; i<mMobileIDs.size(); i++) {
-               os << "(" << mMobileIDs[i] << "),";
+               os << "(" << mMobileIDs[i] << "," << mChannelsNeeded[i] << "),";
        }
        os << ")";
 }

Modified: openbts/branches/developers/dburgess00/veryearly/GSM/GSML3RRMessages.h
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/GSM/GSML3RRMessages.h      
2008-11-26 02:10:50 UTC (rev 10066)
+++ openbts/branches/developers/dburgess00/veryearly/GSM/GSML3RRMessages.h      
2008-11-26 03:08:44 UTC (rev 10067)
@@ -141,6 +141,7 @@
        private:
 
        std::vector<L3MobileIdentity> mMobileIDs;
+       ChannelType mChannelsNeeded[2];
 
 
        public:
@@ -150,19 +151,30 @@
        {
                // The empty paging request is a single untyped mobile ID.
                mMobileIDs.push_back(L3MobileIdentity());
+               mChannelsNeeded[0]=AnyDCCHType;
+               mChannelsNeeded[1]=AnyDCCHType;
        }
 
-       L3PagingRequestType1(const L3MobileIdentity& wId)
+       L3PagingRequestType1(const L3MobileIdentity& wId, ChannelType wType)
                :L3RRMessage()
-       { mMobileIDs.push_back(wId); }
+       {
+               mMobileIDs.push_back(wId);
+               mChannelsNeeded[0]=wType;
+               mChannelsNeeded[1]=AnyDCCHType;
+       }
 
-       L3PagingRequestType1(const L3MobileIdentity& wId1, const 
L3MobileIdentity& wId2)
+       L3PagingRequestType1(const L3MobileIdentity& wId1, ChannelType wType1,
+                       const L3MobileIdentity& wId2, ChannelType wType2)
                :L3RRMessage()
        {
                mMobileIDs.push_back(wId1);
+               mChannelsNeeded[0]=wType1;
                mMobileIDs.push_back(wId2);
+               mChannelsNeeded[1]=wType2;
        }
 
+       unsigned chanCode(ChannelType) const;
+
        size_t bodyLength() const;
 
        int MTI() const { return PagingRequestType1; }

Modified: openbts/branches/developers/dburgess00/veryearly/SIP/SIPInterface.cpp
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/SIP/SIPInterface.cpp       
2008-11-26 02:10:50 UTC (rev 10066)
+++ openbts/branches/developers/dburgess00/veryearly/SIP/SIPInterface.cpp       
2008-11-26 03:08:44 UTC (rev 10067)
@@ -219,7 +219,7 @@
                        return false;
                }
                DCOUT("SIPInterface::checkInvite: repeated SIP invite, 
repaging") 
-               gBTS.pager().addID(mobile_id);  
+               gBTS.pager().addID(mobile_id,GSM::SDCCHType);   
                transaction.T3113().set();
                gTransactionTable.update(transaction);
                osip_free(to_uri);
@@ -254,7 +254,7 @@
        
        // Add to paging list.
        DCOUT("SIPInterface::checkInvite: new SIP invite, initial paging") 
-       gBTS.pager().addID(mobile_id);  
+       gBTS.pager().addID(mobile_id,GSM::SDCCHType);   
 
        osip_free(to_uri);
        return true;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]