laforge
/
openbts-osmo
Archived
1
0
Fork 0

Transparently pass TP-UHDI (User-Data-Header-Indicator) from SMS-SUBMIT to SMS-DELIVER.

Among other things this allows us to correctly pass-through concatenated SMS messages.
master
Alexander Chemeris 12 years ago committed by Thomas Tsou
parent 63202cbf24
commit ef988a4b2f
  1. 10
      public-trunk/SMS/SMSMessages.cpp
  2. 8
      public-trunk/SMS/SMSMessages.h

@ -536,7 +536,6 @@ size_t TLUserData::length() const
// The reported value includes the length byte itself.
// The length() method only needs to work for formats supported
// by the write() method.
assert(!mUDHI); // We don't support user headers.
assert(mDCS<0x100); // Someone forgot to initialize the DCS.
size_t sum = 1; // Start by counting the TP-User-Data-Length byte.
#if 1
@ -677,10 +676,12 @@ size_t TLSubmit::bodyLength() const
void TLSubmit::parseBody(const TLFrame& src, size_t& rp)
{
bool udhi;
parseRD(src);
parseVPF(src);
parseRP(src);
parseUDHI(src);
udhi = parseUDHI(src);
parseSRR(src);
mMR = src.readField(rp,8);
mDA.parse(src,rp);
@ -689,6 +690,7 @@ void TLSubmit::parseBody(const TLFrame& src, size_t& rp)
mVP.VPF(mVPF);
mVP.parse(src,rp);
mUD.DCS(mDCS);
mUD.UDHI(udhi);
mUD.parse(src,rp);
}
@ -699,7 +701,7 @@ void TLSubmit::text(ostream& os) const
os << " RD=" << mRD;
os << " VPF=" << mVPF;
os << " RP=" << mRP;
os << " UDHI=" << mUDHI;
os << " UDHI=" << mUD.UDHI();
os << " SRR=" << mSRR;
os << " MR=" << mMR;
os << " DA=(" << mDA << ")";
@ -721,7 +723,7 @@ void TLDeliver::writeBody(TLFrame& dest, size_t& wp) const
{
writeMMS(dest);
writeRP(dest);
writeUDHI(dest);
writeUDHI(dest, mUD.UDHI());
writeSRI(dest);
mOA.write(dest,wp);
dest.writeField(wp,mPID,8);

@ -259,7 +259,7 @@ class TLMessage {
bool mSRR; ///< status report request
bool mSRI; ///< status report indication
bool mSRQ; ///< status report qualifier
bool mUDHI; ///< user-data header-indicator
// bool mUDHI; ///< user-data header-indicator. Stored in TLUserData.
bool mRP; ///< reply path
//@}
@ -279,7 +279,7 @@ class TLMessage {
};
TLMessage()
:mMMS(false),mSRI(false),mUDHI(false),mRP(true)
:mMMS(false),mSRI(false),mRP(true)
{}
virtual ~TLMessage(){}
@ -320,8 +320,8 @@ class TLMessage {
void parseSRI(const TLFrame& fm) { mSRI=fm[2]; }
void writeSRQ(TLFrame& fm) const { fm[2]=mSRQ; }
void parseSRQ(const TLFrame& fm) { mSRQ=fm[2]; }
void writeUDHI(TLFrame& fm) const { fm[1]=mUDHI; }
void parseUDHI(const TLFrame& fm) { mUDHI=fm[1]; }
void writeUDHI(TLFrame& fm, bool udhi) const { fm[1]=udhi; }
bool parseUDHI(const TLFrame& fm) { return fm[1]; }
void writeRP(TLFrame& fm) const { fm[0]=mRP; }
void parseRP(const TLFrame& fm) { mRP=fm[0]; }
void writeUnused(TLFrame& fm) const { fm.fill(0,3,2); } ///< Fill unused bits with 0s