Exemple #1
0
 def parseOA(self,buffer):
     length = sum(divmod(buffer.nextInt(f='OA Length'),2))
     type = buffer.nextInt(f='OA Type')
     self.OAtype = (type >> 4) & 7
     self.OAplan = type & 15
     if self.OAtype == 5:
         self.OAnumber = decode_septets(buffer.next(length,f='OA'))
     elif self.OAtype == 1:
         self.OAnumber = "+" + decode_number(buffer.nextArray(length,f='OA'))
     else:
         self.OAnumber = decode_number(buffer.nextArray(length,f='OA'))
Exemple #2
0
 def parseSCAddress(self,buffer):
     length = buffer.nextInt(f="SCA Length")
     type = buffer.nextInt(f='SCA Type')
     self.SCtype = (type >> 4) & 7
     self.SCplan = type & 15
     if self.SCtype == 5:
         self.SCnumber = decode_septets(buffer.next(length-1,f='SCA'))
     elif self.SCtype == 1:
         self.SCnumber = "+" + decode_number(buffer.nextArray(length-1,f='SCA'))
     else:
         self.SCnumber = decode_number(buffer.nextArray(length-1,f='SCA'))
Exemple #3
0
 def parseUD(self, buffer):
     length = buffer.nextInt(f='UD Length')
     self.UD = buffer.remainder(f='UD')
     alphabet = self.DataCoding['alphabet']
     if alphabet == 0:
         self.decoded = decode_septets(self.UD)
     elif alphabet == 1:
         self.decoded = self.UD.decode('hex')
     elif alphabet == 2:
         self.decoded = unicode(self.UD.decode('hex'), 'utf-16be')
     else:
         raise SMSException("Unsupported Alphabet - Reserved")
Exemple #4
0
 def parseOA(self, buffer):
     length = sum(divmod(buffer.nextInt(f='OA Length'), 2))
     type = buffer.nextInt(f='OA Type')
     self.OAtype = (type >> 4) & 7
     self.OAplan = type & 15
     if self.OAtype == 5:
         self.OAnumber = decode_septets(buffer.next(length, f='OA'))
     elif self.OAtype == 1:
         self.OAnumber = "+" + decode_number(
             buffer.nextArray(length, f='OA'))
     else:
         self.OAnumber = decode_number(buffer.nextArray(length, f='OA'))
Exemple #5
0
 def parseUD(self,buffer):
     length = buffer.nextInt(f='UD Length')
     self.UD = buffer.remainder(f='UD')
     alphabet = self.DataCoding['alphabet']
     if alphabet == 0:
         self.decoded = decode_septets(self.UD)
     elif alphabet == 1:
         self.decoded = self.UD.decode('hex')
     elif alphabet == 2:
         self.decoded = unicode(self.UD.decode('hex'),'utf-16be')
     else:
         raise SMSException("Unsupported Alphabet - Reserved")
Exemple #6
0
 def parseSCAddress(self, buffer):
     length = buffer.nextInt(f="SCA Length")
     type = buffer.nextInt(f='SCA Type')
     self.SCtype = (type >> 4) & 7
     self.SCplan = type & 15
     if self.SCtype == 5:
         self.SCnumber = decode_septets(buffer.next(length - 1, f='SCA'))
     elif self.SCtype == 1:
         self.SCnumber = "+" + decode_number(
             buffer.nextArray(length - 1, f='SCA'))
     else:
         self.SCnumber = decode_number(buffer.nextArray(length - 1,
                                                        f='SCA'))