Commit 49603c39 authored by Chris T's avatar Chris T
Browse files

Enable Modem Manager Support via a plugin

This enables modem manager support via a plugin
parent 7e4a527a
......@@ -12,8 +12,8 @@ builtin_sources =
builtin_cflags =
builtin_libadd =
builtin_modules += ofono
builtin_sources += plugins/ofono.c
builtin_modules += ofono modemmanager
builtin_sources += plugins/ofono.c plugins/modemmanager.c
libexec_PROGRAMS = src/mmsd
......@@ -24,7 +24,7 @@ src_mmsd_SOURCES = $(gdbus_sources) $(gweb_sources) $(builtin_sources) \
src/push.h src/push.c src/store.h src/store.c \
src/wsputil.h src/wsputil.c src/mmsutil.h src/mmsutil.c
src_mmsd_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ -lresolv -ldl
src_mmsd_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @MMGLIB_LIBS@ -lresolv -ldl
src_mmsd_LDFLAGS = -Wl,--export-dynamic
......@@ -41,7 +41,7 @@ src/plugin.$(OBJEXT): src/builtin.h
src/builtin.h: src/genbuiltin $(builtin_sources)
$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
AM_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ $(builtin_cflags) \
AM_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @MMGLIB_CFLAGS@ $(builtin_cflags) \
-DMMS_PLUGIN_BUILTIN \
-DPLUGINDIR=\""$(plugindir)"\" \
-DPUSHCONFDIR=\""$(pushconfdir)"\"
......
......@@ -16,12 +16,33 @@ Please note that mmsd alone will not get MMS working! It is designed to work
with a higher level chat application to facilitate fetching and
sending MMS. It interfaces with other applications via the dbus.
Modem Manager specific notes
===========================
Upon start up, mmsd looks for and tracks the state of the modem
that has Modem Messaging (i.e. SMS) capabilities. Since mmsd is a lower
level program, mmsd assumes that other parts of the OS stack/the
higher level chat application track/manage mobile connectivity and SMS.
This design decision was made as to not conflict with the OS stack and the
chat application.
This decision has two primary consequences to be aware of:
- mmsd does NOT manage mobile connectivity, and does not track the state of
mobile connectivity.
- mmsd also NOT watch the Modem Manager SMS dbus interface for new SMS.
Please note that due to limitations of Modem Manager, mmsd does not support
having multiple APNs at the same time (for carriers that seperate MMS APN
from Mobile Data APNs).
Please read "Configuring the Modem Manager Plugin" for configuration.
Compiling mmsd
============================
In order to compile proxy daemon you need following software packages:
- GCC compiler
- D-Bus library
- GLib library
- Modem Manager Library
Installing mmsd
============================
......@@ -74,4 +95,62 @@ TotalMaxAttachmentSize
The maximum size all of your attachments can be before mmsd rejects it.
NOTE: This value is carrier specific! Changing this value to a higher
number may cause your carrier to silently reject MMSes you send.
CHANGE AT YOUR OWN RISK!
\ No newline at end of file
CHANGE AT YOUR OWN RISK!
Configuring the Modem Manager Plugin
===========================
On first run, mmsd will write a settings file at
"$HOME/.mms/modemmanager/ModemManagerSettings"
IMPORTANT NOTE: If you change any settings through the file,
mmsd MUST BE RESTARTED for the changes to take effect!
You can change CarrierMMSC, CarrierMMSProxy, or MMS_APN via
dbus and they will take effect right away, but any
messages sent to the mmsd queue need to be processed
again. The easiest way to do this is to reset mmsd.
But it can be done with the dbus proxy call ProcessMessageQueue().
This settings file needs to be changed before mmsd will connect! The settings
are as follows:
CarrierMMSC
Get this from your carrier.
Carrier MMSC Format: "http://mms.example.com"
CarrierMMSProxy
Get this from your carrier.
MMS Proxy Format: "proxy.example.com:80" or "NULL"
Both the proxy address AND port are required, or else mmsd will not work!
The proxy is "proxy.example.com"
The proxy port is "80"
If you do NOT have a proxy, set this to "NULL"
MMS_APN
Note that at this point, this plugin can only support one bearer at
a time (this works fine for carriers with a combined Internet/MMS APN
but will not function with carriers that have two APNS seperating
the two)
MMS APN Format: "apn.example.com"
AutoProcessOnConnection
Tell mmsd to automatically send and recieve messages when the modem
is connected. This will also allow mmsd to auto send/recieve if the
modem is disconnected and reconnects, suspends and unsuspends, etc.
AutoProcessOnConnection Options: "true" or "false"
An example of what you are looking for is here:
https://www.t-mobile.com/support/devices/not-sold-by-t-mobile/byod-t-mobile-data-and-apn-settings
From this:
CarrierMMSC=http://mms.msg.eng.t-mobile.com/mms/wapenc
MMS_APN=fast.t-mobile.com
CarrierMMSProxy=NULL
......@@ -78,4 +78,9 @@ PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.2, dummy=yes,
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
PKG_CHECK_MODULES(MMGLIB, mm-glib >= 1.10, dummy=yes,
AC_MSG_ERROR(mm-glib >= 1.10 is required))
AC_SUBST(MMGLIB_CFLAGS)
AC_SUBST(MMGLIB_LIBS)
AC_OUTPUT(Makefile)
Message hierarchy
=================
Service org.ofono.mms
Interface org.ofono.mms.ModemManager
Object path /org/ofono/mms
NOTE: This is an independent bus from the rest of mmsd. In order to talk to
Modem Manager, this plugin must work with dbus 2.0. The rest of mmsd
operates on dbus 1.0. Be sure to connect independently to this bus!
Methods
PushNotify()
Send mmsd the contents of an SMS WAP for it to process
See purple-mm-sms for how this is used
Gvariant input Format String (ay)
This is the data contents of the SMS WAP
ChangeSettings()
IMPORTANT NOTE: Settings changed here will work right away, but any
messages sent to the mmsd queue need to be processed
again. The easiest way to do this is to reset mmsd.
But it can be done with the dbus proxy call
ProcessMessageQueue()
This sets and saves the Carrier MMSC, MMS Proxy, and MMS APN
Gvariant Input Format String ((sss))
Argument 1: Carrier MMSC
Argument 2: MMS Proxy
Argument 3: MMS APN
Carrier MMSC
Get this from your carrier.
Carrier MMSC Format: "http://mms.example.com"
MMS Proxy
Get this from your carrier.
MMS Proxy Format: "proxy.example.com:80" or "NULL"
The proxy is "proxy.example.com"
The Proxy port is "80"
Both the proxy address AND port is required, or else mmsd will not work!
If you do NOT have a proxy, set this to "NULL"
MMS APN
Note that at this point, this plugin can only support one bearer at
a time (this works fine for carriers with a combined Internet/MMS APN
but will not function with carriers that have two APNS seperating
the two)
MMS APN Format: "apn.example.com"
Example Python Program to call "ChangeSettings":
#!/usr/bin/python
import pydbus
from pydbus import SessionBus
bus = SessionBus()
TestServer = bus.get("org.ofono.mms.ModemManager", "/org/ofono/mms")
TestServer.ChangeSettings(("http://mms.invalid", "NULL", "apn.invalid"))
#TestServer.ChangeSettings(("http://mms.invalid", "proxy.invalid:80", "apn.invalid"))
ProcessMessageQueue()
This manually activates the Modem Manager Bearer to process any messages
not sent or recieved yet. The primary idea behind is two fold:
a) If the Bearer Handler is misconfigured, the OS/higher level program
can change the settings via the dbus and test the bearer handler
to confirm it works.
b) If modem data is disconnected (manually or due to modem suspend),
the OS/higher level program can also track this and can command
mmsd to now process any messages it needs to send/recieve once
modem data is active.
Since BearerHandlerError() emits a signal for any errors activating the
modem contect, ProcessMessageQueue() does not return any value.
Signals
BearerHandlerError()
If the bearer handler has an issue activating the context, it will emit
a signal of the error. The errors are shown above.
NOTE: MMSD_MM_MODEM_CONTEXT_ACTIVE will never be emitted as a signal.
Gvariant Output Format String (h)
enum {
MMSD_MM_MODEM_MMSC_MISCONFIGURED, //the MMSC is the default value
MMSD_MM_MODEM_NO_BEARERS_ACTIVE, //The Modem has no bearers
MMSD_MM_MODEM_INTERFACE_DISCONNECTED, //mmsd found the right bearer, but it is disconnected
MMSD_MM_MODEM_INCORRECT_APN_CONNECTED, //no APN is connected that matches the settings
MMSD_MM_MODEM_FUTURE_CASE_DISCONNECTED, //Reserved for future case
MMSD_MM_MODEM_CONTEXT_ACTIVE //No error, context activated properly
} mm_context_connection;
Properties None
This diff is collapsed.
......@@ -647,7 +647,7 @@ static void process_request_queue(struct mms_service *service);
static void emit_message_added(const struct mms_service *service,
struct mms_message *msg);
static void activate_bearer(struct mms_service *service)
void activate_bearer(struct mms_service *service)
{
DBG("service %p setup %d active %d", service, service->bearer_setup, service->bearer_active);
......
......@@ -52,3 +52,5 @@ int mms_message_register(struct mms_service *service,
struct mms_message *msg);
int mms_message_unregister(const struct mms_service *service,
const char *msg_path);
void activate_bearer(struct mms_service *service);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment