Changes between Version 72 and Version 73 of BluePrint/Messaging


Ignore:
Timestamp:
06/17/10 18:58:41 (14 years ago)
Author:
Fran Boon
Comment:

Refactored

Legend:

Unmodified
Added
Removed
Modified
  • BluePrint/Messaging

    v72 v73  
    11[[TOC]]
    22= Blueprint for the Messaging Module =
    3 What we need is:
    4  * Contacts List
    5   * Just uses normal Groups & Persons?
    6   * Do we need to extend these at all? (to mark that they're used for a these purposes & have some logic to identify whether all members of a group have emails &/or SMS'able Tel#s. Mark the members when we get delivery failures?)
    7  * SMS Router
    8   * Routes incoming message according to whether it's using specialist micro-syntax (e.g. submitting an XForm to another controller)
    9   * Non-XForms messages get sent to the [wiki:BluePrintTicketing Ticketing] module's Master Message Log
    10   * Tagged messages also get Routed to the appropriate area (Project / Location / Organisation)
    11  * SMS alerts (security alerts more common than natural disasters)
    12   * Being able to trigger an SMS alert broadcast upon reception of an SMS
    13    * Is this just an XForm to a Group? (Can we pre-populate the XForm to do this whenever a certain number is called or just a single word routes here?)
    14  * CAP alerts:
    15   * http://xml.coverpages.org/OASIS-CAPv11-200510.pdf
    16    * Use an XSLT?
    17    * http://code.google.com/p/pyedxl/source/browse/trunk/edxl/edxl.py
    18   * Subset of EDXL-DE: http://docs.oasis-open.org/emergency/edxl-de/v1.0/EDXL-DE_Spec_v1.0.pdf
    19   * http://talksahana.com/2009/03/04/firefox-browser-cap-alerting-plugin-sahana-idea-for-gsoc2009/
    20  * Admin UI for:
    21   * Email Settings
    22   * SMS Settings
    23  * SMS login / data entry / reports
    24   * [wiki:BluePrintMessagingModuleJ2ME J2ME client]
    25  * Hashtag decoding
    26   * Geo
    27    * [http://en.wikipedia.org/wiki/Geohash GeoHashes] ([http://pypi.python.org/pypi/Geohash/ Python lib])
    28    * Tweets
    29     * [http://dev.twitter.com/doc/get/geo/:id Geotagging] where hardware/software combination available: place_id from http://twitter.com/{username}/statuses/{tweet_id}.json -> http://api.twitter.com/1/geo/id/{place_id}.json
    30     * otherwise use WW place WW message:
    31      * http://www.weather.gov/stormreports/
    32      * http://www.srh.noaa.gov/media/epz/Twitter/TwitterStormReportProgram.wmv
    33 === Core Architecture ===
    34 Instead of having several "apps" that cross-talk, such as sms, email, tweet, jabber, etc, it would be good to have a central messaging core that has 'connectors'. This would be the equivalent of a star-hub structure.
     3The Messaging Module is a modular system for getting Messages in & out of Sahana Eden & routed around it.
    354
    36 This way, additional 'connectors' could be added or used as needed without refactoring the entire code base, and would allow sending messages from one connector to another, such as sms to email or email to jabber.
    37 
    38 Need to have per-user inboxes (e.g. to support workflow)
    39 
    40 === Message Flows ===
     5== Core Architecture ==
    416 * When a message is picked up by the handler, it decides whether it's an XForm or not.
    427 * If it is, then it is routed direct to the relevant resource.
     
    5318   * The XML exporter inserts one element <message url="..." unread="True/False"/> per message and resource element as child of the <resource> tag
    5419   * This can be used for any feeds that are produced of the XML exporter
    55    * Requires: make RSS feeds a XML export template (which it is not up to now)
     20   * ~~Requires: make RSS feeds a XML export template~~
    5621
    5722[[Image(Message Flows.png)]]
    58 ==== How do we achieve this? ====
     23
     24=== How do we achieve this? ===
    5925 * Table {{{msg_log}}} is used as a replacement for the current {{{msg_inbox}}}, {{{msg_outbox}}} & {{{ticket_log}}}.
    6026  * Fields: sender, subject, body, verified, actionable, assignee (multiple?), actioned, priority
     
    8854   * Q: If a message is routed to a resource, does this automatically mark ticket as 'actioned'? Provide a popup to ask this?
    8955 * Q: How do we handle Auth restrictions?
    90 === User Interface ===
     56
     57== Parser ==
     58[pyparsing.wikispaces.com Pyparsing] is included in the modules folder.
     59
     60Thsi can decode messages from compressed formats such as Tweets or SMS
     61=== Geo ===
     62 * [http://en.wikipedia.org/wiki/Geohash GeoHashes] ([http://pypi.python.org/pypi/Geohash/ Python lib])
     63 * Tweets
     64  * [http://dev.twitter.com/doc/get/geo/:id Geotagging] where hardware/software combination available: place_id from http://twitter.com/{username}/statuses/{tweet_id}.json -> http://api.twitter.com/1/geo/id/{place_id}.json
     65  * otherwise use WW place WW message:
     66   * http://www.weather.gov/stormreports/
     67   * http://www.srh.noaa.gov/media/epz/Twitter/TwitterStormReportProgram.wmv
     68
     69== User Interface ==
    9170The home page should be a common Inbox view which, by default, shows all new unread Items (the 'Ticketing Module').
    9271
     
    9978There should be a 2nd box to create a Rich-text message, with the option of adding attachments. This content just gets sent to those members of the group with an Email address specified.
    10079
    101 We don't need the option of having Email or SMS groups - all groups are 'Both'.
    102 
    103 If a user is added to a group we warn about any missing details, but still allow addition (the ref is by person.id so addresses can eb added/changed later anyway).
     80If a user is added to a group we warn about any missing details, but still allow addition (the ref is by pe_pentity.id so addresses can be added/changed later anyway).
    10481
    10582When sending we need to provide warning messages about users for whom details weren't available.
    10683
     84== Transports ==
    10785=== Email ===
    108 tools.py has mail settings:
     86{{{gluon/tools.py}}} has mail settings:
    10987{{{
    11088mail=MailS3()
     
    12199 * http://groups.google.com/group/web2py/browse_thread/thread/f6c903f9c67cfe2e
    122100
    123 There is a Cron job to check the contents of the !OutBox & send pending messages. On Success it moves the message to the 'Sent' table:
     101There is a Cron job to check the contents of the Outbox & send pending messages. On Success it marks the message as 'Sent':
    124102 * http://web2py.com/examples/default/cron
    125103
    126104==== Rich Text ====
    127 
    128105We'd like to be able to send HTML mails for rich-text support (including attachments)
    129106This requires the use of smtplib to send MIME-encoded files:
     
    133110
    134111=== SMS ===
    135 
    136 Need to be able to support both online gateways (such as Clickatell) & local hardware such as:
     112Support both online gateways (such as Clickatell) & local hardware such as:
    137113 * a Bluetooth mobile phone
    138114 * [http://www.mobigater.bg MobiGater] – Takes 1 sim card. Cost approx EUR 70.
     
    140116 * [http://www.google.com/products?client=safari&rls=en-us&q=multimodem+mtcba-g-f4&oe=UTF-8&um=1&ie=UTF-8&ei=H-6BSpO1DJS-NpC6gaAL&sa=X&oi=product_result_group&ct=title&resnum=4 Multi-Tech MultiModem GPRS MTCBA-G-F4]
    141117
    142 The SMS Daemon to handle Inbound messages is a separate Python script.
     118The SMS Handler Daemon to handle Inbound messages is a separate Python script.
     119 * Routes incoming message according to whether it's using specialist micro-syntax (e.g. submitting an XForm to another controller)
     120 * Non-XForms messages get sent to the [wiki:BluePrintTicketing Ticketing] module's Master Message Log
     121 * Tagged messages also get Routed to the appropriate area (Project / Location / Organisation)
    143122
    144123It can distinguish between simple messages (added to the Inbox of the Messaging Module) & those which are encoded in Binary XML (the output of XForms from the J2ME client).
     
    146125Implementation details are here: http://wiki.sahanafoundation.org/doku.php/dev:pythonsms
    147126
    148 Q: Do we use Cron to check Outbox & signal the daemon to send Pending messages? (as for email)
     127We use Cron to check Outbox & signal the daemon to send Pending messages (as for email)
     128
     129SMS alerts (security alerts more common than natural disasters):
     130 * Being able to trigger an SMS alert broadcast upon reception of an SMS
     131  * Is this just an XForm to a Group? (Can we pre-populate the XForm to do this whenever a certain number is called or just a single word routes here?)
     132
     133SMS login / data entry / reports
     134 * [wiki:BluePrintMessagingModuleJ2ME J2ME client]
    149135
    150136Would be good to add an LCR (Least-Cost Routing engine) for SMS deliveries (so that e.g. local messages routed via modem, but International via Gateway).
     
    163149 * UserGuidelinesMsg#WhatHardwaredoIneed
    164150
     151=== APRS ===
     152Automatic Packet Reporting System used by Amateur Radio networks:
     153 * http://en.wikipedia.org/wiki/Automatic_Packet_Reporting_System
     154
     155=== CAP ===
     156Common Alerting Protocol:
     157 * http://xml.coverpages.org/OASIS-CAPv11-200510.pdf
     158  * Use an XSLT?
     159 * Subset of EDXL-DE: http://docs.oasis-open.org/emergency/edxl-de/v1.0/EDXL-DE_Spec_v1.0.pdf
     160  * http://code.google.com/p/pyedxl/source/browse/trunk/edxl/edxl.py
     161 * http://talksahana.com/2009/03/04/firefox-browser-cap-alerting-plugin-sahana-idea-for-gsoc2009/
     162
    165163=== Twitter ===
    166164Adding support for sending out/receiving alerts via Twitter would be nice.
     
    169167 * [http://dev.twitter.com/doc Twitter API]
    170168
     169=== XForms ===
     170We have {{{controllers/xforms.py}}} to generate XForms automatically out of Sahana models.
     171
    171172=== XMPP ===
     173Instant Messaging & Presence including !GoogleTalk:
    172174 * http://code.google.com/apis/talk/open_communications.html
    173175
    174 === Alternate implementations ===
     176== Alternate implementations ==
    175177 * Agasti design: http://wiki.sahanafoundation.org/doku.php?id=dev:msg_archi
    176178 * Agasti User Guide http://wiki.sahanafoundation.org/doku.php?id=doc:message:english