Changes between Version 72 and Version 73 of BluePrint/Messaging
- Timestamp:
- 06/17/10 18:58:41 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BluePrint/Messaging
v72 v73 1 1 [[TOC]] 2 2 = 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. 3 The Messaging Module is a modular system for getting Messages in & out of Sahana Eden & routed around it. 35 4 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 == 41 6 * When a message is picked up by the handler, it decides whether it's an XForm or not. 42 7 * If it is, then it is routed direct to the relevant resource. … … 53 18 * The XML exporter inserts one element <message url="..." unread="True/False"/> per message and resource element as child of the <resource> tag 54 19 * 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~~ 56 21 57 22 [[Image(Message Flows.png)]] 58 ==== How do we achieve this? ==== 23 24 === How do we achieve this? === 59 25 * Table {{{msg_log}}} is used as a replacement for the current {{{msg_inbox}}}, {{{msg_outbox}}} & {{{ticket_log}}}. 60 26 * Fields: sender, subject, body, verified, actionable, assignee (multiple?), actioned, priority … … 88 54 * Q: If a message is routed to a resource, does this automatically mark ticket as 'actioned'? Provide a popup to ask this? 89 55 * 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 60 Thsi 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 == 91 70 The home page should be a common Inbox view which, by default, shows all new unread Items (the 'Ticketing Module'). 92 71 … … 99 78 There 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. 100 79 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). 80 If 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). 104 81 105 82 When sending we need to provide warning messages about users for whom details weren't available. 106 83 84 == Transports == 107 85 === Email === 108 tools.pyhas mail settings:86 {{{gluon/tools.py}}} has mail settings: 109 87 {{{ 110 88 mail=MailS3() … … 121 99 * http://groups.google.com/group/web2py/browse_thread/thread/f6c903f9c67cfe2e 122 100 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:101 There is a Cron job to check the contents of the Outbox & send pending messages. On Success it marks the message as 'Sent': 124 102 * http://web2py.com/examples/default/cron 125 103 126 104 ==== Rich Text ==== 127 128 105 We'd like to be able to send HTML mails for rich-text support (including attachments) 129 106 This requires the use of smtplib to send MIME-encoded files: … … 133 110 134 111 === SMS === 135 136 Need to be able to support both online gateways (such as Clickatell) & local hardware such as: 112 Support both online gateways (such as Clickatell) & local hardware such as: 137 113 * a Bluetooth mobile phone 138 114 * [http://www.mobigater.bg MobiGater] – Takes 1 sim card. Cost approx EUR 70. … … 140 116 * [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] 141 117 142 The SMS Daemon to handle Inbound messages is a separate Python script. 118 The 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) 143 122 144 123 It 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). … … 146 125 Implementation details are here: http://wiki.sahanafoundation.org/doku.php/dev:pythonsms 147 126 148 Q: Do we use Cron to check Outbox & signal the daemon to send Pending messages? (as for email) 127 We use Cron to check Outbox & signal the daemon to send Pending messages (as for email) 128 129 SMS 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 133 SMS login / data entry / reports 134 * [wiki:BluePrintMessagingModuleJ2ME J2ME client] 149 135 150 136 Would 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). … … 163 149 * UserGuidelinesMsg#WhatHardwaredoIneed 164 150 151 === APRS === 152 Automatic Packet Reporting System used by Amateur Radio networks: 153 * http://en.wikipedia.org/wiki/Automatic_Packet_Reporting_System 154 155 === CAP === 156 Common 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 165 163 === Twitter === 166 164 Adding support for sending out/receiving alerts via Twitter would be nice. … … 169 167 * [http://dev.twitter.com/doc Twitter API] 170 168 169 === XForms === 170 We have {{{controllers/xforms.py}}} to generate XForms automatically out of Sahana models. 171 171 172 === XMPP === 173 Instant Messaging & Presence including !GoogleTalk: 172 174 * http://code.google.com/apis/talk/open_communications.html 173 175 174 == = Alternate implementations ===176 == Alternate implementations == 175 177 * Agasti design: http://wiki.sahanafoundation.org/doku.php?id=dev:msg_archi 176 178 * Agasti User Guide http://wiki.sahanafoundation.org/doku.php?id=doc:message:english