|
2016-10-15
, 00:16
|
Posts: 75 |
Thanked: 269 times |
Joined on Aug 2012
|
#2
|
statusarr = phoneif.get_registration_status()[0] if statusarr != 0: log.info("not in home network, not downloading..") if self.cont.ui: if not self.cont.continue_download_roaming(): log.info("user declined to download while roaming") raise Exception('User is roaming, not downloading') return else: self.connector = None raise Exception('User is roaming, not downloading')
The Following 4 Users Say Thank You to Ilew For This Useful Post: | ||
|
2016-10-15
, 16:35
|
Posts: 9 |
Thanked: 29 times |
Joined on Oct 2016
|
#3
|
The Following 4 Users Say Thank You to cg132 For This Useful Post: | ||
|
2016-10-15
, 22:44
|
Posts: 75 |
Thanked: 269 times |
Joined on Aug 2012
|
#4
|
'To retrieve the MMS your active connection you need to connect to the internet, proceed?'
'To retrieve the MMS your active connection will need to change. Switch connection?'
Index: connectors.py =================================================================== --- connectors.py (revision 1) +++ connectors.py (working copy) @@ -19,6 +19,7 @@ CONNMODE_ICDSWITCH = 2 CONNMODE_FORCESWITCH = 3 CONNMODE_NULL = 10 +ROAMMODE_IGNORE = 2 class MasterConnector: """ handles setting up and (might) take down connection(s) """ @@ -39,14 +40,16 @@ phoneobj = bus.get_object('com.nokia.phone.net', '/com/nokia/phone/net') phoneif = dbus.Interface(phoneobj, 'Phone.Net') statusarr = phoneif.get_registration_status()[0] - if statusarr != 0: - log.info("not in home network, not downloading..") + if (self.config.get_roammode() == ROAMMODE_IGNORE) and statusarr != 0: if self.cont.ui: if not self.cont.continue_download_roaming(): log.info("user declined to download while roaming") raise Exception('User is roaming, not downloading') - return + return + else: + log.info("user accepted to download while roaming") else: + log.info("not in home network, not downloading..") self.connector = None raise Exception('User is roaming, not downloading') #return Index: controller_gtk.py =================================================================== --- controller_gtk.py (revision 1) +++ controller_gtk.py (working copy) @@ -186,7 +186,7 @@ dialog = gtk.Dialog() dialog.set_title(gettext.ldgettext('osso-connectivity-ui', 'conn_fi_phone_network_data_roam')) #dialog.set_transient_for(self.window) - label = gtk.Label(_("To retrieve the MMS your active connection you need to connect to the internet, proceed?")) + label = gtk.Label("To retrieve the MMS your active connection will use data roaming, proceed?") label.set_line_wrap(True) dialog.vbox.add(label) dialog.add_button(gtk.STOCK_YES, 1) Index: fmms_config.py =================================================================== --- fmms_config.py (revision 1) +++ fmms_config.py (working copy) @@ -19,6 +19,8 @@ CONNMODE_ICDSWITCH = 2 CONNMODE_FORCESWITCH = 3 CONNMODE_NULL = 10 +ROAMMODE_PROMPT = 1 +ROAMMODE_IGNORE = 2 class fMMS_config: @@ -61,6 +63,8 @@ self.set_version("Unknown") if self.get_connmode() == None: self.set_connmode(CONNMODE_FORCESWITCH) + if self.get_roammode() == None: + self.set_roammode(ROAMMODE_PROMPT) if self.get_db_path() == None: self.set_db_path("/home/user/.fmms/mms.db") if not self.get_useragent(): @@ -82,6 +86,7 @@ self.set_firstlaunch(1) self.set_img_resize_width(240) self.set_connmode(CONNMODE_FORCESWITCH) + self.set_roammode(ROAMMODE_PROMPT) def get_old_mmsc(self): return self.client.get_string(self._fmmsdir + 'mmsc') @@ -98,6 +103,12 @@ def get_connmode(self): return self.client.get_int(self._fmmsdir + "connmode") + def set_roammode(self, val): + self.client.set_int(self._fmmsdir + "roammode", int(val)) + + def get_roammode(self): + return self.client.get_int(self._fmmsdir + "roammode") + def get_last_ui_dir(self): return self.client.get_string(self._fmmsdir + "lastuidir") Index: fmms_config_dialog.py =================================================================== --- fmms_config_dialog.py (revision 1) +++ fmms_config_dialog.py (working copy) @@ -76,7 +76,22 @@ self.icdbutton = hildon.GtkToggleButton(gtk.HILDON_SIZE_FINGER_HEIGHT) self.icdbutton.set_label(_("Polite")) self.icdsignal = self.icdbutton.connect('toggled', self.conn_mode_toggled) + + expRBox = gtk.HBox() + exp_label2 = gtk.Label("Roaming Mode") + exp_label2.set_width_chars(labelwidth) + exp_label2.set_line_wrap(True) + exp_label2.set_alignment(0, 0.5) + rbox = gtk.HButtonBox() + rbox.set_property("name", "GtkHBox2") + self.promptbutton = hildon.GtkToggleButton(gtk.HILDON_SIZE_FINGER_HEIGHT) + self.promptbutton.set_label(_("Prompt")) + self.promptsignal = self.promptbutton.connect('toggled', self.roam_mode_toggled) + self.ignorebutton = hildon.GtkToggleButton(gtk.HILDON_SIZE_FINGER_HEIGHT) + self.ignorebutton.set_label(_("Ignore")) + self.ignoresignal = self.ignorebutton.connect('toggled', self.roam_mode_toggled) + # Set the correct button to be active self.connmode_setactive() @@ -90,9 +105,22 @@ expHBox.pack_start(exp_label, False, True, 0) expHBox.pack_start(alignment, False, True, 0) + # Set the correct button to be active + self.roammode_setactive() + + rbox.pack_start(self.promptbutton, True, False, 0) + rbox.pack_start(self.ignorebutton, True, False, 0) + + alignment = gtk.Alignment(0.5, 0.5, 0, 0) + alignment.add(rbox) + + expRBox.pack_start(exp_label2, False, True, 0) + expRBox.pack_start(alignment, False, True, 0) + allVBox.pack_start(apnHBox, False, False, 2) #allVBox.pack_start(numberHBox, False, False, 2) allVBox.pack_start(imgwidthHBox, False, False, 2) + allVBox.pack_end(expRBox, False, False, 2) allVBox.pack_end(expHBox, False, False, 2) allVBox.show_all() @@ -163,6 +191,34 @@ elif self.config.get_connmode() == fMMSconf.CONNMODE_FORCESWITCH: self.rudebutton.set_active(True) + def roam_mode_toggled(self, widget): + """ Ugly hack used since its ToggleButtons """ + self.promptbutton.handler_block(self.promptsignal) + self.ignorebutton.handler_block(self.ignoresignal) + if self.promptbutton == widget: + self.promptbutton.set_active(True) + self.ignorebutton.set_active(False) + elif self.rudebutton == widget: + self.promptcbutton.set_active(False) + self.ignorebutton.set_active(True) + self.promptbutton.handler_unblock(self.promptsignal) + self.ignorebutton.handler_unblock(self.ignoresignal) + return True + + def roammode_option(self): + """ Returns which 'Roaming Mode' button is active. """ + if self.promptbutton.get_active(): + return fMMSconf.ROAMMODE_PROMPT + elif self.ignorebutton.get_active(): + return fMMSconf.ROAMMODE_IGNORE + + def roammode_setactive(self): + """ Activate one of the 'Roaming Mode' buttons. """ + if self.config.get_roammode() == fMMSconf.ROAMMODE_PROMPT: + self.promptbutton.set_active(True) + elif self.config.get_connmode() == fMMSconf.ROAMMODE_IGNORE: + self.ignorebutton.set_active(True) + def config_menu_button_clicked(self, action): """ Checks if we should save the Configuration options. """ if action == 1: @@ -175,7 +231,9 @@ self.config.set_img_resize_width(size) log.info("Set image width to %s" % size) self.config.set_connmode(self.connmode_option()) - log.info("Set connection mode %s" % self.connmode_option()) + log.info("Set connection mode %s" % self.connmode_option()) + self.config.set_roammode(self.roammode_option()) + log.info("Set roaming mode %s" % self.roammode_option()) banner = hildon.hildon_banner_show_information(self.window, "", \ gettext.ldgettext('osso-connectivity-ui', "conn_ib_settings_saved")) return 0
|
2016-10-16
, 17:17
|
Posts: 9 |
Thanked: 29 times |
Joined on Oct 2016
|
#5
|
Date: Sun, 16 Oct 2016 16:53:14 GMT Server: Mavenir Web Application Server Content-Type: application/vnd.wap.mms-message Content-Length: 621378 2016-10-16 11:54:20,420 fmms.controller: saved binary mms <open file '/home/user/.fmms/mms/mavodi-1-89-84-1-78-1-179-3-78-322a2ff/message', mode 'wb' at 0x422b0b18> 2016-10-16 11:54:20,423 fmms.wappushhandler: fetched http://polmmsget.msg.eng.t-mobile.co...9-3-78-322a2ff and wrote to file 2016-10-16 11:54:20,630 fmms.wappushhandler: sending ack... 2016-10-16 11:54:20,636 fmms.wappushhandler: using custom mms 2016-10-16 11:54:20,755 fmms.wappushhandler: connecting via proxy 216.155.165.50:8080 2016-10-16 11:54:20,760 fmms.wappushhandler: mmschost: http://mms.msg.eng.t-mobile.com/mms/wapenc 2016-10-16 11:54:24,075 fmms.wappushhandler: MMSC STATUS: 200 OK 2016-10-16 11:54:24,083 fmms.wappushhandler: MMSC RESPONDED: {} 2016-10-16 11:54:24,088 fmms.wappushhandler: m-acknowledge-ind: (200, 'OK', {}, True) 2016-10-16 11:54:24,095 fmms.wappushhandler: ack sent 2016-10-16 11:54:24,101 fmms.connectors: UglyHackHandler running disconnect 2016-10-16 11:54:24,384 fmms.connectors: disconnecting connection. rx: 651859 tx: 18747 2016-10-16 11:54:24,394 fmms.connectors: UglyHackHandler running disconnect 2016-10-16 11:54:24,557 fmms.connectors: disconnecting connection. rx: 651859 tx: 18747 2016-10-16 11:54:24,569 fmms.controller: path: /home/user/.fmms/mms/mavodi-1-89-84-1-78-1-179-3-78-322a2ff 2016-10-16 11:54:24,588 fmms.controller: decode_binary_mms running: /home/user/.fmms/mms/mavodi-1-89-84-1-78-1-179-3-78-322a2ff 2016-10-16 11:54:48,887 fmms.controller: returning message! 2016-10-16 11:54:48,909 fmms.controller: storing mms...mavodi-1-89-84-1-78-1-179-3-78-322a2ff 2016-10-16 11:54:48,914 fmms.dbhandler: Something went wrong when inserting Traceback (most recent call last): File "/opt/fmms/dbhandler.py", line 311, in insert_mms_message size = os.path.getsize(fpath) File "/usr/lib/python2.5/posixpath.py", line 139, in getsize return os.stat(filename).st_size OSError: [Errno 2] No such file or directory: '/home/user/.fmms/mms/mavodi-1-139-30-1-78-1-179-3-78-322a2ff/message' 2016-10-16 11:54:48,927 fmms.__main__: Failed to open viewer with transaction id: mavodi-1-89-84-1-78-1-179-3-78-322a2ff Traceback (most recent call last): File "/opt/fmms/fmms_gui.py", line 467, in show_mms fMMSViewer.fMMS_Viewer(transactionid, spawner=self) File "/opt/fmms/fmms_viewer.py", line 59, in __init__ self._parse_mms(fname, vbox) File "/opt/fmms/fmms_viewer.py", line 248, in _parse_mms self.cont.get_mms_from_push(filename) File "/opt/fmms/controller.py", line 291, in get_mms_from_push mmsid = self.store_mms_message(pushid, message) File "/opt/fmms/controller.py", line 248, in store_mms_message mmsid = self.store.insert_mms_message(pushid, message) File "/opt/fmms/dbhandler.py", line 311, in insert_mms_message size = os.path.getsize(fpath) File "/usr/lib/python2.5/posixpath.py", line 139, in getsize return os.stat(filename).st_size OSError: [Errno 2] No such file or directory: '/home/user/.fmms/mms/mavodi-1-139-30-1-78-1-179-3-78-322a2ff/message'
|
2016-10-16
, 18:00
|
Posts: 9 |
Thanked: 29 times |
Joined on Oct 2016
|
#6
|
|
2016-10-16
, 21:16
|
Posts: 75 |
Thanked: 269 times |
Joined on Aug 2012
|
#7
|
mmsid = self.store_mms_message(pushid, message)
mmsid = self.store_mms_message(pushid, message, transactionId=trans_id)
The Following 3 Users Say Thank You to Ilew For This Useful Post: | ||
|
2016-10-17
, 10:47
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#8
|
|
2016-10-17
, 17:50
|
Posts: 9 |
Thanked: 29 times |
Joined on Oct 2016
|
#9
|
If you're willing to be a guinea pig, I may have a simple fix for the images not showing.
Could you change line 291 in '/opt/fmms/controller.py' from:
toCode:mmsid = self.store_mms_message(pushid, message)
Pretty much it's reading a different transaction-id to the one it's using to store the binary.Code:mmsid = self.store_mms_message(pushid, message, transactionId=trans_id)
So it's looking in a non-existent dir and failing.
Cheers,
Ilew
The Following 3 Users Say Thank You to cg132 For This Useful Post: | ||
|
2016-10-17
, 21:05
|
Posts: 75 |
Thanked: 269 times |
Joined on Aug 2012
|
#10
|
My inbox is emptied again
I propose to wait a while and see what else comes out/pops up and then I might push a new version to extras-devel repository.
Zomg! I had resigned myself to never getting a usual MMS and then llew comes out with a little gem and provides the answer to all the unanswered posts I've been reading about decoding, returning, sorting, something went wrong.
You my friend are brilliant! If I could thank you more than once I would. =D
Oh yeah... did I mention it worked?
woohoo!
The Following 2 Users Say Thank You to Ilew For This Useful Post: | ||
So... fMMS.... whatta beast....
I've spent a great deal of time trying different settings and getting my operator to confirm some details about what works and what doesn't as far as their network goes. Also spent a great deal of time reading about other troubles with fMMS and it doesn't appear I've been experiencing one of the common issues.
Using fMMS 1.3.5 and I'm getting this error about roaming...
2016-10-14 14:52:28,501 fmms.connectors: not in home network, not downloading..
2016-10-14 14:52:32,961 fmms.connectors: user declined to download while roaming
So it appears I've declined downloads while roaming. Unfortunately I'm never in the home network area as I've moved out to the twigs for a job.
Does anyone know where to allow downloads while roaming? Is this a fMMS thing or a Fremantle thing?
Oh, maybe I should mention I can send MMS but not receive. I know that's not too helpful but now you know where I'm coming from.
Again sorry if I'm a nuisance, I am a noob. I've been using this phone for about 4 days. I'm not a developer. I do work with linux professionally so I am comfortable with the OS but still.... this quirk has me stumped.
Cheers,
Mike
p.s. phone settings show data roaming always allow so... meh... whats going on.
Last edited by cg132; 2016-10-14 at 21:33. Reason: p.s.