commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10074 - openbts/branches/developers/dburgess00/veryea


From: dburgess00
Subject: [Commit-gnuradio] r10074 - openbts/branches/developers/dburgess00/veryearly/Control
Date: Wed, 26 Nov 2008 12:03:54 -0700 (MST)

Author: dburgess00
Date: 2008-11-26 12:03:54 -0700 (Wed, 26 Nov 2008)
New Revision: 10074

Modified:
   openbts/branches/developers/dburgess00/veryearly/Control/CallControl.cpp
   openbts/branches/developers/dburgess00/veryearly/Control/ControlCommon.h
Log:
Call controllers to support either early or very early
assignment in call setup.  Part of tracker item #316.


Modified: 
openbts/branches/developers/dburgess00/veryearly/Control/CallControl.cpp
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/Control/CallControl.cpp    
2008-11-26 19:02:27 UTC (rev 10073)
+++ openbts/branches/developers/dburgess00/veryearly/Control/CallControl.cpp    
2008-11-26 19:03:54 UTC (rev 10074)
@@ -456,15 +456,20 @@
 
 
 /**
-       This function starts MOC to the point of TCH assignment. 
+       This function starts MOC on the SDCCH to the point of TCH assignment. 
        @param req The CM Service Request that started all of this.
-       @param SDCCH The SDCCH used to initiate call setup.
+       @param LCH The logical used to initiate call setup.
 */
-void Control::MOCStarter(const L3CMServiceRequest* req, SDCCHLogicalChannel 
*SDCCH)
+void Control::MOCStarter(const L3CMServiceRequest* req, LogicalChannel *LCH)
 {
+       assert(LCH);
        assert(req);
        CLDCOUT("MOC: " << *req);
 
+       // Determine if very early assignment already happened.
+       bool veryEarly=false;
+       if (LCH->type()==TCHFType) veryEarly=true;
+
        // FIXME -- At this point, verify the that subscriber has access to 
this service.
        // If the subscriber isn't authorized, send a CM Service Reject with
        // cause code, 0x41, "requested service option not subscribed",
@@ -478,25 +483,28 @@
                // FIXME -- This is quick-and-dirty, not following GSM 04.08 5.
                CERR("WARNING -- (ControlLayer) MOC setup with no IMSI");
                // Cause 0x60 "Invalid mandatory information"
-               SDCCH->send(L3CMServiceReject(L3RejectCause(0x60)));
-               SDCCH->send(L3ChannelRelease());
+               LCH->send(L3CMServiceReject(L3RejectCause(0x60)));
+               LCH->send(L3ChannelRelease());
                // The SIP side and transaction record don't exist yet.
                // So we're done.
                return;
        }
 
-       // Allocate a TCH for the call.
-       TCHFACCHLogicalChannel *TCH = allocateTCH(SDCCH);
-       // It's OK to just return on failure; allocateTCH cleaned up already.
-       if (TCH==NULL) return;
+       // Allocate a TCH for the call, if we don't have it already.
+       TCHFACCHLogicalChannel *TCH = NULL;
+       if (!veryEarly) {
+               TCH = allocateTCH(dynamic_cast<SDCCHLogicalChannel*>(LCH));
+               // It's OK to just return on failure; allocateTCH cleaned up 
already.
+               if (TCH==NULL) return;
+       }
 
        // Let the phone know we're going ahead with the transaction.
        CLDCOUT("MOC: sending CMServiceAccept")
-       SDCCH->send(L3CMServiceAccept());
+       LCH->send(L3CMServiceAccept());
 
        // Get the Setup message.
        // GSM 04.08 5.2.1.2
-       const L3Setup *setup = dynamic_cast<const L3Setup*>(getMessage(SDCCH));
+       const L3Setup *setup = dynamic_cast<const L3Setup*>(getMessage(LCH));
        if (setup==NULL) throw UnexpectedMessage();
        CLDCOUT("MOC: " << *setup);
        // Pull out the L3 short transaction information now.
@@ -506,8 +514,8 @@
                // FIXME -- This is quick-and-dirty, not following GSM 04.08 5.
                CERR("WARNING -- (ControlLayer) MOC setup with no number");
                // Cause 0x60 "Invalid mandatory information"
-               SDCCH->send(L3ReleaseComplete(0,L3TI,L3Cause(0x60)));
-               SDCCH->send(L3ChannelRelease());
+               LCH->send(L3ReleaseComplete(0,L3TI,L3Cause(0x60)));
+               LCH->send(L3ChannelRelease());
                // The SIP side and transaction record don't exist yet.
                // So we're done.
                return;
@@ -527,16 +535,16 @@
                setup->calledPartyBCDNumber());
        transaction.SIP().User(IMSI);
        transaction.Q931State(TransactionEntry::MOCInitiated);
-       SDCCH->transactionID(transaction.ID());
-       TCH->transactionID(transaction.ID());
+       LCH->transactionID(transaction.ID());
+       if (!veryEarly) TCH->transactionID(transaction.ID());
        CLDCOUT("MOC: transaction: " << transaction);
        gTransactionTable.add(transaction);
 
        // At this point, we have enough information start the SIP call setup.
        // We have 2 seconds to repsond to the MS.  ITU-T Q.931 Table 9-1, T303.
 
-       // Now start a call by contacting asterisk. engine methods will return 
their 
-       // current state.       
+       // Now start a call by contacting asterisk.
+       // Engine methods will return their current state.      
        // The remote party will start ringing soon.
        CLDCOUT("MOC: starting SIP (INVITE) Calling "<<bcd_digits);
        unsigned basePort = allocateRTPPorts();
@@ -548,14 +556,17 @@
        delete setup;
 
        // The transaction is moving on to the MOCController.
+       // If we need a TCH assignment, we do it here.
        gTransactionTable.update(transaction);
        CLDCOUT("MOC: transaction: " << transaction);
-       // This call also opens the TCH.
-       assignTCHF(SDCCH,TCH);
+       if (veryEarly) 
MOCController(transaction,dynamic_cast<TCHFACCHLogicalChannel*>(LCH));
+       else assignTCHF(dynamic_cast<SDCCHLogicalChannel*>(LCH),TCH);
 }
 
 
 
+
+
 /**
        Continue MOC process on the TCH.
        @param transaction The call state and SIP interface.
@@ -565,6 +576,7 @@
 {
        CLDCOUT("MOC: transaction: " << transaction);
        unsigned L3TI = transaction.TIValue();
+       assert(TCH);
 
        // Once we can start SIP call setup, send Call Proceeding.
        CLDCOUT("MOC: Sending Call Proceeding ");
@@ -682,16 +694,24 @@
 
 
 
-void Control::MTCStarter(const L3PagingResponse *resp, 
-                                               SDCCHLogicalChannel *SDCCH)
+void Control::MTCStarter(const L3PagingResponse *resp, LogicalChannel *LCH)
 {
        assert(resp);
        CLDCOUT("MTC: " << *resp);
+       assert(LCH);
 
+       // Determine if very early assigment already happened.
+       bool veryEarly = false;
+       if (LCH->type()==TCHFType) veryEarly=true;
+
        // Allocate a TCH for the call.
-       TCHFACCHLogicalChannel *TCH = allocateTCH(SDCCH);
-       // The orphaned transaction will be cleared at the next findByMobileID 
call.
-       if (TCH==NULL) return;
+       TCHFACCHLogicalChannel *TCH = NULL;
+       if (!veryEarly) {
+               TCH = allocateTCH(dynamic_cast<SDCCHLogicalChannel*>(LCH));
+               // It's OK to just return on failure; allocateTCH cleaned up 
already.
+               // The orphaned transaction will be cleared at the next 
findByMobileID call.
+               if (TCH==NULL) return;
+       }
 
        // Find the transction table entry that was created when the phone was 
paged.
        CLDCOUT("MTC: find TransactionEntry for " << resp->mobileIdentity());
@@ -701,13 +721,13 @@
                return;
        }
        CLDCOUT("MTC: transaction: "<< transaction);
-       TCH->transactionID(transaction.ID());   
-       SDCCH->transactionID(transaction.ID()); 
+       if (!veryEarly) TCH->transactionID(transaction.ID());   
+       LCH->transactionID(transaction.ID());   
        unsigned L3TI = transaction.TIValue();
 
        // GSM 04.08 5.2.2.1
        CLDCOUT("MTC: sending GSM Setup");
-       SDCCH->send(L3Setup(0,L3TI));
+       LCH->send(L3Setup(0,L3TI));
        transaction.T303().set();
        transaction.Q931State(TransactionEntry::CallPresent);
 
@@ -716,11 +736,11 @@
        while (transaction.Q931State()!=TransactionEntry::MTCConfirmed) {
                if (transaction.SIP().MTCSendTrying()==SIP::Fail) {
                        TCH->send(RELEASE);
-                       return abortCall(transaction,SDCCH,L3Cause(0x7F));
+                       return abortCall(transaction,LCH,L3Cause(0x7F));
                }
                // FIXME -- What's the proper timeout here?
                // It's the SIP TRYING timeout, whatever that is.
-               if (updateGSMSignalling(transaction,SDCCH,1000)) {
+               if (updateGSMSignalling(transaction,LCH,1000)) {
                        CLDCOUT("MTC: Release from GSM side");
                        TCH->send(RELEASE);
                        return;
@@ -728,18 +748,18 @@
                // Check for SIP cancel, too.
                if (transaction.SIP().MTCWaitForACK()==SIP::Fail) {
                        TCH->send(RELEASE);
-                       return abortCall(transaction,SDCCH,L3Cause(0x7F));
+                       return abortCall(transaction,LCH,L3Cause(0x7F));
                }
        }
 
        // The transaction is moving to the MTCController.
        gTransactionTable.update(transaction);
        CLDCOUT("MTC: transaction: " << transaction);
-       assignTCHF(SDCCH,TCH);
+       if (veryEarly) 
MTCController(transaction,dynamic_cast<TCHFACCHLogicalChannel*>(LCH));
+       else assignTCHF(dynamic_cast<SDCCHLogicalChannel*>(LCH),TCH);
 }
 
 
-
 void Control::MTCController(TransactionEntry& transaction, 
TCHFACCHLogicalChannel* TCH)
 {
        // Early Assignment Mobile Terminated Call. 
@@ -747,6 +767,7 @@
 
        CLDCOUT("MTC: transaction: " << transaction);
        unsigned L3TI = transaction.TIValue();
+       assert(TCH);
 
        // Get the alerting message.
        CLDCOUT("MTC:: waiting for GSM Alerting and Connect");

Modified: 
openbts/branches/developers/dburgess00/veryearly/Control/ControlCommon.h
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/Control/ControlCommon.h    
2008-11-26 19:02:27 UTC (rev 10073)
+++ openbts/branches/developers/dburgess00/veryearly/Control/ControlCommon.h    
2008-11-26 19:03:54 UTC (rev 10074)
@@ -149,7 +149,9 @@
 
 /address@hidden Functions for radio resource operations. */
 //@{
+/** Decode RACH bits and send an immediate assignment. */
 void AccessGrantResponder(unsigned requestReference, const GSM::Time& when);
+/** Find and compelte the in-process transaction associated with a paging 
repsonse. */
 void PagingResponseHandler(const GSM::L3PagingResponse*, 
GSM::SDCCHLogicalChannel*);
 //@}
 
@@ -157,13 +159,17 @@
 //@{
 /address@hidden MOC */
 //@{
-void MOCStarter(const GSM::L3CMServiceRequest* req, GSM::SDCCHLogicalChannel 
*SDCCH);
-void MOCController(TransactionEntry& transaction, GSM::TCHFACCHLogicalChannel* 
TCHFACCH);
+/** Run the MOC to the point of alerting, doing early assignment if needed. */
+void MOCStarter(const GSM::L3CMServiceRequest*, GSM::LogicalChannel*);
+/** Complete the MOC connection. */
+void MOCController(TransactionEntry&, GSM::TCHFACCHLogicalChannel*);
 //@}
 /address@hidden MTC */
 //@{
-void MTCStarter(const GSM::L3PagingResponse *resp, GSM::SDCCHLogicalChannel 
*SDCCH);
-void MTCController(TransactionEntry& transaction, GSM::TCHFACCHLogicalChannel* 
TCHFACCH);
+/** Run the MTC to the point of alerting, doing early assignment if needed. */
+void MTCStarter(const GSM::L3PagingResponse*, GSM::LogicalChannel*);
+/** Complete the MTC connection. */
+void MTCController(TransactionEntry&, GSM::TCHFACCHLogicalChannel*);
 //@}
 /address@hidden MOSMS */
 //@{
@@ -186,6 +192,7 @@
 //@{
 void FACCHDispatcher(GSM::TCHFACCHLogicalChannel *TCHFACCH);
 void SDCCHDispatcher(GSM::SDCCHLogicalChannel *SDCCH);
+void DCCHDispatcher(GSM::LogicalChannel *DCCH);
 //@}
 
 





reply via email to

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