View Single Post
Posts: 64 | Thanked: 84 times | Joined on Oct 2012
#62
Well i have a similar problem with fmms. Ever since our great glorious provider changed some settings i receive mms with no receiver. I am kinda trying to fix it by myself but have some issues.
Ok the log says that it cannot get the sender from the push data.

Code:
2016-11-18 07:48:34,742 fmms.__main__: Incoming SMS Push!
2016-11-18 07:48:34,769 fmms.__main__: SRC: MMS:9200
2016-11-18 07:48:34,771 fmms.__main__: DST: 2948
2016-11-18 07:48:34,775 fmms.__main__: decoding...
2016-11-18 07:48:34,789 fmms.controller: content-location: http://mms.telekom.si/MB//7D18F876
2016-11-18 07:48:34,792 fmms.controller: transid: 7D18F876
2016-11-18 07:48:34,796 fmms.controller: No sender value defined: <type 'exceptions.KeyError'> 'From'
Traceback (most recent call last):
  File "/opt/fmms/controller.py", line 160, in decode_mms_from_push
    sndr = wsplist["From"]
KeyError: 'From'
2016-11-18 07:48:34,822 fmms.controller: saved binary push: <open file '/home/user/.fmms/push/7D18F876', mode 'wb' at 0x569188>
2016-11-18 07:48:35,182 fmms.contacts: loaded contacthandler in 0.18 s
2016-11-18 07:48:35,632 fmms.__main__: saving...
2016-11-18 07:48:36,148 fmms.dbhandler: inserted row as: 624
2016-11-18 07:48:37,295 fmms.__main__: fetching mms...
ok i checked the saved binary push file and inside i can see the sender number
Code:
Œ‚˜7D18F876 ‘Š€Ž·ˆô€ƒhttp://mms.telekom.si/MB//7D18F876 ‰€+38641666666/TYPE=PLMN –êFwd: Fwd: Fwd:
i think that the problem is somewhere in the decideNessageHeaderToList fuction as it does not return the sender from the decoded binary data.
Code:
 def decodeMessageHeaderToList(self, data):
        """ Decodes the (full) MMS header data
        
        @note: This B{must} be called before C{_decodeBody()}, as it sets
        certain internal variables relating to data lengths, etc.
        """
        dataIter = PreviewIterator(data)
        
        # First 3  headers (in order
        ############################
        # - X-Mms-Message-Type
        # - X-Mms-Transaction-ID
        # - X-Mms-Version
        # TODO: reimplement strictness - currently we allow these 3 headers 
        #       to be mixed with any of the other headers (this allows the
        #       decoding of "broken" MMSs, but is technically incorrect
           
        # Misc headers
        ##############
        # The next few headers will not be in a specific order, except for
        # "Content-Type", which should be the last header
        # According to [4], MMS header field names will be short integers
        # If the message type is a M-Notification* or M-Acknowledge
        #type we don't expect any ContentType and should break on
        # StopIteration exception
        contentTypeFound = False
        contentLocationFound = False
        while (contentTypeFound == False):
            try:
            	header, value = self.decodeHeader(dataIter)
            except StopIteration, e:
            	print e, e.args
            	break
            if header == MMSEncodingAssignments.fieldNames[0x04][0]:
                contentTypeFound = True
            elif header == MMSEncodingAssignments.fieldNames[0x03][0]:
                contentLocationFound = True
                break
                #pass
            else:
            	try:
			self._mmsMessage.headers[header] = value
			#print '%s: %s' % (header, str(value))
		except StopIteration, e:
			print e, e.args
			break
        
        cType = value[0]
        #print '%s: %s' % (header, cType)
        params = value[1]
        #for parameter in params:
        #    print '    %s: %s' % (parameter, str(params[parameter]))

        self._mmsMessage.headers[header] = (value)
        return self._mmsMessage.headers
The only data that gets returned (i think, still debuging a bit) and is later inserted into the pust_headers table are the following rows adn there is no from row
Code:
3422	624	Message-Class	Personal
3423	624	Message-Size	1719
3424	624	MMS-Version	1.1
3425	624	Expiry	259200
3426	624	Content-Type	('application/vnd.wap.multipart.mixed', {'Start': '<smil>', 'Type': 'application/smil'})
ok here is also the last incoming push message
Code:
MMS
9200
2948
dbus.Array([dbus.Byte(97), dbus.Byte(112), dbus.Byte(112), dbus.Byte(108), dbus.Byte(105), dbus.Byte(99), dbus.Byte(97), dbus.Byte(116), dbus.Byte(105), dbus.Byte(111), dbus.Byte(110), dbus.Byte(47), dbus.Byte(118), dbus.Byte(110), dbus.Byte(100), dbus.Byte(46), dbus.Byte(119), dbus.Byte(97), dbus.Byte(112), dbus.Byte(46), dbus.Byte(109), dbus.Byte(109), dbus.Byte(115), dbus.Byte(45), dbus.Byte(109), dbus.Byte(101), dbus.Byte(115), dbus.Byte(115), dbus.Byte(97), dbus.Byte(103), dbus.Byte(101), dbus.Byte(0), dbus.Byte(175), dbus.Byte(132)], signature=dbus.Signature('y'))
dbus.Array([dbus.Byte(140), dbus.Byte(130), dbus.Byte(152), dbus.Byte(55), dbus.Byte(68), dbus.Byte(49), dbus.Byte(56), dbus.Byte(70), dbus.Byte(56), dbus.Byte(55), dbus.Byte(54), dbus.Byte(0), dbus.Byte(141), dbus.Byte(145), dbus.Byte(138), dbus.Byte(128), dbus.Byte(142), dbus.Byte(2), dbus.Byte(6), dbus.Byte(183), dbus.Byte(136), dbus.Byte(5), dbus.Byte(129), dbus.Byte(3), dbus.Byte(3), dbus.Byte(244), dbus.Byte(128), dbus.Byte(131), dbus.Byte(104), dbus.Byte(116), dbus.Byte(116), dbus.Byte(112), dbus.Byte(58), dbus.Byte(47), dbus.Byte(47), dbus.Byte(109), dbus.Byte(109), dbus.Byte(115), dbus.Byte(46), dbus.Byte(116), dbus.Byte(101), dbus.Byte(108), dbus.Byte(101), dbus.Byte(107), dbus.Byte(111), dbus.Byte(109), dbus.Byte(46), dbus.Byte(115), dbus.Byte(105), dbus.Byte(47), dbus.Byte(77), dbus.Byte(66), dbus.Byte(47), dbus.Byte(47), dbus.Byte(55), dbus.Byte(68), dbus.Byte(49), dbus.Byte(56), dbus.Byte(70), dbus.Byte(56), dbus.Byte(55), dbus.Byte(54), dbus.Byte(0), dbus.Byte(137), dbus.Byte(24), dbus.Byte(128), dbus.Byte(43), dbus.Byte(51), dbus.Byte(56), dbus.Byte(54), dbus.Byte(52), dbus.Byte(49), dbus.Byte(55), dbus.Byte(52), dbus.Byte(50), dbus.Byte(49), dbus.Byte(56), dbus.Byte(54), dbus.Byte(47), dbus.Byte(84), dbus.Byte(89), dbus.Byte(80), dbus.Byte(69), dbus.Byte(61), dbus.Byte(80), dbus.Byte(76), dbus.Byte(77), dbus.Byte(78), dbus.Byte(0), dbus.Byte(150), dbus.Byte(16), dbus.Byte(234), dbus.Byte(70), dbus.Byte(119), dbus.Byte(100), dbus.Byte(58), dbus.Byte(32), dbus.Byte(70), dbus.Byte(119), dbus.Byte(100), dbus.Byte(58), dbus.Byte(32), dbus.Byte(70), dbus.Byte(119), dbus.Byte(100), dbus.Byte(58), dbus.Byte(0)], signature=dbus.Signature('y'))

so if anyone has any idea... i am kinda new to this python/mms thingy.
Maybe if i would be able to understand the decodeMessageHeaderToList function or how the push message gets decoded i could do a fix but... well am trying to figure out stuff

Last edited by shubell; 2016-11-18 at 09:48.
 

The Following 3 Users Say Thank You to shubell For This Useful Post: