Multimedia Messaging Service
****************************

Copyright (C) 2010-2011  Intel Corporation. All rights reserved.
Updated 2021 by: Mohammad Sadiq, kent, kop316, 
                 fuzzy7k, craftyguy, anteater
Parts adapted from: https://source.puri.sm/Librem5/purple-mm-sms
                    Copyright (C) 2018 Purism SPC
                    
About
===========================
mmsd is a lower level daemon that transmits and recieves MMSes. It works with
both the ofono stack and the Modem Manager stack.

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
============================

To configure run:
    ./bootstrap-configure --prefix=/usr/

Configure automatically searches for all required components and packages.

To compile, run:
    make
	
And to Install:
    make install

mmsd will be installed in /${prefix}/libexec (if you are following this guide,
it is /usr/libexec )

To uninstall, simply remove the "mmsd" binary from /${prefix}/libexec or run:
    sudo make uninstall

Note that you must manually configure your favorite service manager to run 
the daemon, as this installer does not configure it to autorun.

Testing out mmsd
===========================
To configure, run:
    ./bootstrap-configure --enable-debug --enable-maintainer-mode

Make it:
    make 

Run daemon in foreground with debugging:
    ./src/mmsd -n -d 'src/*'

General Configuration
===========================
On first run, mmsd will write a settings file at
"$HOME/.mms/$PLUGIN/mms"

IMPORTANT NOTE: If you change settings in this file, mmsd MUST BE RESTARTED 
                for the changes to take effect!

This settings file use sane defaults, but you can change them:

UseDeliveryReports
        Whether you want delivery reports for MMSes you send

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!

Configuring the Modem Manager Plugin
===========================
On first run, mmsd will write a settings file at
"$HOME/.mms/modemmanager/ModemManagerSettings"

IMPORTANT NOTE: If the Carrier MMSC, MMS Proxy, or MMS APN
                are changed from the file, mmsd MUST BE RESTARTED 
                for the changes to take effect! You can also change them 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:

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"
            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"
        
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


