02-01-2021, 11:47 AM
(01-28-2021, 05:16 PM)kop316 Wrote: So good news! I think I have the Telus issue resolved. Thank you Futurebucket for your help resolving it.
Np, Thanks for your work on MMSD!
For reference I've tested
- Group chats texts
- Group chats Pictures
- Group chats Lots of pictures and text
- 1:1 pictures
- 1:1 lots of pictures and text.
If anyone wants to play around, the below python3 code should get you most of the way there. IIRC, all you need to change is "/org/freedesktop/ModemManager1/SMS/40" to be the sms ID. Run the listen script first to get the reply then run the send script.
to "receive" an MMS you take the "data" part of the SMS off modem manager and you forward that to mmds over the dbus.
It'll reply on a different interface with an mms file and the information you need to extract it.
Send SMS data to MMSD
Code:
#!/usr/bin/python3
import dbus
bus = dbus.SystemBus()
modem = bus.get_object('org.freedesktop.ModemManager1', '/org/freedesktop/ModemManager1/SMS/40')
bus_iface = dbus.Interface(modem, dbus_interface='org.freedesktop.DBus.Properties')
props = bus_iface.GetAll("org.freedesktop.ModemManager1.Sms")
array_de_bytes = dbus.Array([])
for byte in props['Data']:
print("byte " +chr(byte))
array_de_bytes.append(dbus.Byte(byte))
session_bus = dbus.SessionBus()
dbus_mmmms_object = session_bus.get_object('org.ofono.mms.ModemManager', '/org/ofono/mms')
dbus_mmmms_properties = dbus.Interface(dbus_mmmms_object, dbus_interface='org.ofono.mms.ModemManager')
sms_properties = dbus_mmmms_properties.PushNotify(array_de_bytes)
And listen for the reply
Code:
#!/usr/bin/python3
#for dbus listening - sms/mms recieve.
from gi.repository import GLib
import dbus
import dbus.mainloop.glib
def mm_message_added(dbus_sms_path, sms_type):
#sms_type 1 == receive
#sms_type 0 == send
print(dbus_sms_path)
print(sms_type)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus.add_signal_receiver( handler_function = mm_message_added,
bus_name="org.ofono.mms",
path = "/org/ofono/mms/modemmanager",
dbus_interface = "org.ofono.mms.Service",
signal_name = "MessageAdded")
mainloop = GLib.MainLoop()
mainloop.run()